I have an issue with the internationalization system. I want my default language when packaging to be different than the native one.
I’m french, so I write all my texts in french and translate everything using the localization system inside unreal to english. When packaging I want the game to be in english by default. As far as I understand, unreal goes to the native language when nothing has been set yet. In game I will have a menu to chose, but before the user has set anything I’m afraid everything will be in french, which is not a good move…
Does anyone have a way of setting the default language to something other than the native one ?
In case anyone else wondering, the root of issue is Engine/Source/Runtime/Core/Private/Internationalization/TextLocalizationManager.cpp , in function void ApplyDefaultCultureSettings(const ELocalizationLoadFlags LocLoadFlags), at the next block:
FString FallbackLanguage = TEXT("en");
if (EnumHasAnyFlags(LocLoadFlags, ELocalizationLoadFlags::Game))
{
// If this is a game, use the native culture of the game as the fallback
FString NativeGameCulture = FTextLocalizationManager::Get().GetNativeCultureName(ELocalizedTextSourceCategory::Game);
if (!NativeGameCulture.IsEmpty())
{
FallbackLanguage = MoveTemp(NativeGameCulture);
}
}
If native culture is set, the fallback is hardcoded to native one. Which i agree is not adequate.
From there you may compile your own engine without this if at all, or come up with some nicer way to workaround this