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