Add C# current culture sync with localization system
This commit is contained in:
@@ -158,13 +158,22 @@ namespace FlaxEngine
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
|
||||
Localization.LocalizationChanged += OnLocalizationChanged;
|
||||
|
||||
OnLocalizationChanged();
|
||||
if (!Engine.IsEditor)
|
||||
{
|
||||
CreateGuiStyle();
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnLocalizationChanged()
|
||||
{
|
||||
var currentThread = Thread.CurrentThread;
|
||||
currentThread.CurrentUICulture = Localization.CurrentLanguage;
|
||||
currentThread.CurrentCulture = Localization.CurrentCulture;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the managed window as a main game window. Called after creating game window by the native code.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user