Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
don't load locale from config if on previewer
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Feb 15, 2022
1 parent fae40b5 commit 4788ab0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Ryujinx.Ava/Common/Locale/LocaleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ public void Load()
{
string localeLanguageCode = CultureInfo.CurrentCulture.Name.Replace('-', '_');

if (!string.IsNullOrEmpty(ConfigurationState.Instance.Ui.LanguageCode.Value))
if (Program.PreviewerDetached)
{
localeLanguageCode = ConfigurationState.Instance.Ui.LanguageCode.Value;
if (!string.IsNullOrEmpty(ConfigurationState.Instance.Ui.LanguageCode.Value))
{
localeLanguageCode = ConfigurationState.Instance.Ui.LanguageCode.Value;
}
}

// Load english first, if the target language translation is incomplete, we default to english.
Expand Down Expand Up @@ -101,8 +104,11 @@ public void LoadLanguage(string languageCode)
this[item.Key] = item.Value;
}

ConfigurationState.Instance.Ui.LanguageCode.Value = languageCode;
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
if (Program.PreviewerDetached)
{
ConfigurationState.Instance.Ui.LanguageCode.Value = languageCode;
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
}
}
}
}

0 comments on commit 4788ab0

Please sign in to comment.