Skip to content

Commit

Permalink
Merge pull request #295 from JasonXuDeveloper/development
Browse files Browse the repository at this point in the history
fixed #294 + fixed localization bug
  • Loading branch information
JasonXuDeveloper authored Apr 7, 2022
2 parents 6d4082c + 23ede1d commit 0e204fa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,18 @@ public static string GetString(string key)
Init();
}

if (_phrases != null && !_phrases.TryGetValue(_language,out var dic))
if (_phrases != null && !_phrases.ContainsKey(_language))
{
string newLang = _phrases.Keys.ToList().Find(k => k.Split('-')[0] == _language.Split('-')[0]);
string newLang = _phrases.Keys.ToList().Find(k => k.StartsWith($"{_language.Split('-')[0]}-"));
if (_language != "zh-cn" && newLang == null)
{
newLang = "zh-cn";
}
else
else if (newLang == null)
{
return $"[invalid language: {_language}]";;
return $"[invalid language: {_language}]";
}

Log.PrintError($"不存在语言{_language},自动替换为{newLang}");
ChangeLanguage(newLang);
}
Expand Down
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion UnityProject/HotUpdateScripts/HotUpdateScripts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<Compile Include="JEngine\Core\JSaver.cs" />
<Compile Include="JEngine\Core\JObjectPool.cs" />
<Compile Include="JEngine\Core\JBehaviour.cs" />
<Compile Include="JEngine\Core\JResource.cs" />
<Compile Include="JEngine\Core\JAction.cs" />
<Compile Include="JEngine\Core\StringifyHelper.cs" />
<Compile Include="JEngine\Core\JPrefab.cs" />
Expand Down
99 changes: 0 additions & 99 deletions UnityProject/HotUpdateScripts/JEngine/Core/JResource.cs

This file was deleted.

0 comments on commit 0e204fa

Please sign in to comment.