Fix locale on Android

This commit is contained in:
Wojtek Figat
2021-07-13 12:51:04 +02:00
parent 16f7194f62
commit 38e2824415
2 changed files with 5 additions and 0 deletions

View File

@@ -164,6 +164,9 @@ void LocalizationService::OnLocalizationChanged()
Instance.LocalizedStringTables.Add(table->Get(), table->Count());
}
#if PLATFORM_ANDROID
// Android doesn't support locales in the native C library (https://issuetracker.google.com/issues/36974962)
#else
// Change C++ locale (eg. used by fmt lib for values formatting)
{
char localeName[100];
@@ -188,6 +191,7 @@ void LocalizationService::OnLocalizationChanged()
}
std::locale::global(std::locale(localeName));
}
#endif
// Send event
Localization::LocalizationChanged();

View File

@@ -535,6 +535,7 @@ void JNICALL Java_com_flaxengine_GameActivity_nativeSetPlatformInfo(JNIEnv* env,
DeviceBuildNumber = ToString(env, deviceBuildNumber);
SystemVersion = ToString(env, systemVersion);
SystemLanguage = ToString(env, systemLanguage);
SystemLanguage.Replace('_', '-');
ScreenWidth = screenWidth;
ScreenHeight = screenHeight;
CacheDir = ToString(env, cacheDir);