Skip to content

Commit 2f29562

Browse files
committed
Fix CHS and CHT translation loading #14
2 parents 450dca8 + 1ad8493 commit 2f29562

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

HomeLive.Plugins/Properties/Resources.Designer.cs

+18-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HomeLive.Plugins/Properties/Resources.resx

+4-4
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@
142142
<data name="lang_ko" type="System.Resources.ResXFileRef, System.Windows.Forms">
143143
<value>..\Resources\translations\lang_ko.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
144144
</data>
145-
<data name="lang_zh" type="System.Resources.ResXFileRef, System.Windows.Forms">
146-
<value>..\Resources\translations\lang_zh.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
145+
<data name="lang_zh_Hans" type="System.Resources.ResXFileRef, System.Windows.Forms">
146+
<value>..\Resources\translations\lang_zh-Hans.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
147147
</data>
148-
<data name="lang_zh2" type="System.Resources.ResXFileRef, System.Windows.Forms">
149-
<value>..\Resources\translations\lang_zh2.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
148+
<data name="lang_zh_Hant" type="System.Resources.ResXFileRef, System.Windows.Forms">
149+
<value>..\Resources\translations\lang_zh-Hant.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
150150
</data>
151151
</root>

HomeLive.Plugins/Utils/WinFormsTranslator.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ private static ReadOnlySpan<string> GetTranslationFile(string lang)
9393
{
9494
var file = GetTranslationFileNameInternal(lang);
9595
// Check to see if a the translation file exists in the same folder as the executable
96-
string externalLangPath = GetTranslationFileNameExternal(file);
96+
string externalLangPath = GetTranslationFileNameExternal(lang);
9797
if (File.Exists(externalLangPath))
9898
{
9999
try { return File.ReadAllLines(externalLangPath); }
100100
catch { /* In use? Just return the internal resource. */ }
101101
}
102102

103-
var txt = (string?)Properties.Resources.ResourceManager.GetObject(file);
103+
var txt = (string?)Properties.Resources.ResourceManager.GetObject(file.Replace('-', '_'));
104104
return txt is null ? [] : txt.Split("\r\n");
105105
}
106106

0 commit comments

Comments
 (0)