mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-02-19 23:31:07 +00:00
fix new locale files data loading (ryubing/ryujinx!245)
See merge request ryubing/ryujinx!245
This commit is contained in:
@@ -190,7 +190,7 @@ namespace Ryujinx.Ava.Common.Locale
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (LocalesJson file in _localeData.Value.LocalesFiles.Values)
|
foreach ((string fileName, LocalesJson file) in _localeData.Value.LocalesFiles)
|
||||||
{
|
{
|
||||||
foreach (LocalesEntry locale in file.Locales)
|
foreach (LocalesEntry locale in file.Locales)
|
||||||
{
|
{
|
||||||
@@ -206,7 +206,7 @@ namespace Ryujinx.Ava.Common.Locale
|
|||||||
$"Locale key {{{locale.ID}}} has too many languages! Has {locale.Translations.Count} translations, expected {_localeData.Value.Languages.Count}!");
|
$"Locale key {{{locale.ID}}} has too many languages! Has {locale.Translations.Count} translations, expected {_localeData.Value.Languages.Count}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Enum.TryParse<LocaleKeys>(locale.ID, out LocaleKeys localeKey))
|
if (!Enum.TryParse<LocaleKeys>(fileName == "Root.json" ? locale.ID : $"{fileName[..^".json".Length]}_{locale.ID}" , out LocaleKeys localeKey))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string str = locale.Translations.TryGetValue(languageCode, out string val) && !string.IsNullOrEmpty(val)
|
string str = locale.Translations.TryGetValue(languageCode, out string val) && !string.IsNullOrEmpty(val)
|
||||||
|
|||||||
Reference in New Issue
Block a user