瀏覽代碼

Translation returns wanted text key if not found

habeebweeb 4 年之前
父節點
當前提交
ce1515d5d7
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Translation.cs

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

@@ -56,13 +56,13 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             if (!Translations.ContainsKey(category))
             {
                 Debug.LogWarning($"Could not find category '{category}'");
-                return null;
+                return text;
             }
 
             if (!Translations[category].ContainsKey(text))
             {
                 Debug.LogWarning($"Could not find translation for '{text}' in '{category}'");
-                return null;
+                return text;
             }
 
             return Translations[category][text];
@@ -77,8 +77,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             return list.Select(uiName =>
             {
-                string text = Get(category, uiName);
-                return string.IsNullOrEmpty(text) ? uiName : text;
+                return Get(category, uiName);
             });
         }
 
@@ -86,8 +85,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             return list.Select(kvp =>
             {
-                string text = Get(category, kvp.Key);
-                return string.IsNullOrEmpty(text) ? kvp.Key : text;
+                return Get(category, kvp.Key);
             }).ToArray();
         }
     }