com.xmobitea.changx.mini-localization 1.4.5 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@
12
12
  [CustomEditor(typeof(LocalizationManager))]
13
13
  public class LocalizationManagerEditor : Editor
14
14
  {
15
- private const string Version = "1.4.2";
15
+ private const string Version = "1.4.7";
16
16
  private const string Library = @".\Library\PackageCache\com.xmobitea.changx.mini-localization@" + Version;
17
17
  //private const string Library = @".\Assets\MiniLocalization";
18
18
  private const string ProcessPath = @"\Editor\Tools\GetLocalizationTools";
@@ -209,6 +209,10 @@
209
209
 
210
210
  contentBuilder.AppendLine(" public const string " + validKey + " = " + "\"" + key + "\";");
211
211
  }
212
+ else
213
+ {
214
+ Debug.LogError("[Localization] Dupplicate key " + key);
215
+ }
212
216
  }
213
217
  }
214
218
 
@@ -90,14 +90,18 @@
90
90
  var key = node.Attributes.GetNamedItem("name").Value;
91
91
  var text = node.InnerText.Replace("\\n", "\n").Replace("&lt;", "<").Replace("&gt;", ">").Replace("&#38;", "&").Replace("&#39;", "'").Replace("&#34;", "\"");
92
92
 
93
- if (textLocalizationDic.ContainsKey(key)) Debug.LogError("[Localization] " + key + " " + " duplicate");
94
- else textLocalizationDic[key] = text;
93
+ if (textLocalizationDic.ContainsKey(key))
94
+ {
95
+ Debug.LogError("[Localization] " + key + " " + " duplicate");
96
+ }
97
+
98
+ textLocalizationDic[key] = text;
95
99
  }
96
100
  }
97
101
  }
98
102
 
99
103
  #if ADDRESSABLE
100
- if (thisLanguage.XMLRef != null)
104
+ if (thisLanguage.XMLRef != null && thisLanguage.XMLRef.RuntimeKeyIsValid())
101
105
  {
102
106
  thisLanguage.XMLRef.LoadAssetAsync().Completed += (handle) =>
103
107
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.xmobitea.changx.mini-localization",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "displayName": "XmobiTea Localization",
5
5
  "description": "XmobiTea Unity package",
6
6
  "unity": "2020.3",