Merge pull request #3056 from sgkoishi/pr3056
Automatic language detection
This commit is contained in:
commit
f71f3b865c
1 changed files with 6 additions and 0 deletions
|
|
@ -60,6 +60,12 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LanguageManager.Instance.ActiveCulture == GameCulture.DefaultCulture)
|
||||||
|
{
|
||||||
|
var bf = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static;
|
||||||
|
// LanguageManager.SetLanguage will change this so we need to reset it back to null
|
||||||
|
typeof(CultureInfo).GetField("s_currentThreadUICulture", bf)?.SetValue(null, null);
|
||||||
|
}
|
||||||
return CultureInfo.CurrentUICulture;
|
return CultureInfo.CurrentUICulture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue