Explorar el Código

Create translation dictionary on initialize

Create the dictionary regardless if the translation files could not be
found. Ensures MPS won't crash when trying to get translations.
habeebweeb hace 4 años
padre
commit
31c97abab3

+ 4 - 4
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Translation.cs

@@ -38,6 +38,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             string rootTranslationPath = Path.Combine(Constants.configPath, Constants.translationDirectory);
             string currentTranslationPath = Path.Combine(rootTranslationPath, language);
 
+            Translations = new Dictionary<string, Dictionary<string, string>>(
+                StringComparer.InvariantCultureIgnoreCase
+            );
+
             if (!Directory.Exists(currentTranslationPath))
             {
                 Utility.LogWarning(
@@ -46,10 +50,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 return;
             }
 
-            Translations = new Dictionary<string, Dictionary<string, string>>(
-                StringComparer.InvariantCultureIgnoreCase
-            );
-
             foreach (string prop in props)
             {
                 string translationFile = $"translation.{prop}.json";