Is it possible to get the OS language of an android or IOS device?

Hi,

I would like to know if it’s possible to get the language of a mobile device. For exemple, if my android/IOS phone is in french, I would like to set the language of my unreal app in french. I want to avoid the user to choose a language.

Thanks

In AndroidMisc.h file there is a function called getOsLanguage() which will give the os language

1 Like

It’s possible using this function:

#if PLATFORM_ANDROID
#include "Android/AndroidPlatformMisc.h"
#else
#include "Internationalization/Culture.h"
#endif

...

FString Language;
#if PLATFORM_ANDROID
    Language = FAndroidMisc::GetOSLanguage(); //for Android devices
#else
    Language = FInternationalization::Get().GetCurrentLanguage()->GetName(); //for PC 
#endif

Hope it can help someone, I used it on Meta Quest Oculus and it works great