mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Server manager language will default to the computers language setting on first start, if possible.
Translation file updated
This commit is contained in:
parent
eaefac83cc
commit
d93cdaef0e
8 changed files with 111 additions and 48 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue