Server manager language will default to the computers language setting on first start, if possible.

Translation file updated
This commit is contained in:
Brett Hewitson 2022-01-14 17:04:59 +10:00
parent eaefac83cc
commit d93cdaef0e
8 changed files with 111 additions and 48 deletions

View file

@ -15,7 +15,7 @@ namespace WPFSharp.Globalizer
{
#region Members
internal const string FallBackLanguage = "en-US";
public const string FallBackLanguage = "en-US";
#endregion
@ -35,14 +35,14 @@ namespace WPFSharp.Globalizer
/// </summary>
public void SwitchLanguage(string inFiveCharLang, bool inForceSwitch = false)
{
if (CultureInfo.CurrentCulture.Name.Equals(inFiveCharLang) && !inForceSwitch)
return;
if (!AvailableLanguages.Instance.Contains(inFiveCharLang))
{
throw new CultureNotFoundException(string.Format("The language {0} is not available.", inFiveCharLang));
inFiveCharLang = FallBackLanguage;
}
if (CultureInfo.CurrentCulture.Name.Equals(inFiveCharLang) && !inForceSwitch)
return;
// Set the new language
var ci = new CultureInfo(inFiveCharLang);
Thread.CurrentThread.CurrentCulture = ci;