How to fetch the mobile/OS language?

Hi all,

I am a newbie to Unreal Engine and currently localizing a small mobile game. I have localized to few languages and and need to open the game in that language (if translated) by just comparing the Mobile language.

Can we fetch the mobile language in Unreal? if yes how? Please give some suggestions.

Thank you!

Sounds like you’ve rolled your own localization system for your game. Unreal does provide one that you can read about here:

If you want to use your own localization system you can still use Unreal’s internationalization system which provides the device/OS desired locale information for you.

FInternationalization::Get().GetCurrentCulture();

FInternationalization also has a OnCultureChanged() event that you can listen to if you allow your users to change their locale in-game.

Wow! Thank you Sarge. I will try to follow the forum and get back to you if I have any problem. Have a nice weekend!

Hi Sarge,
I am using the version UE 4.7.6. Should I need to upgrade to 4.8 (as explained in the forum) to do this task? Any possibilities in the old version?

Also please suggest using BP way for (FInternationalization::Get().GetCurrentCulture():wink: Where should I use this command in the project? Please give some input on this :slight_smile:

Thank you!

Hey Vasanth,

4.8 is still in preview and I don’t recommend updating to that version until it’s closer to it’s stable release. In versions before 4.8 the localization dashboard doesn’t exist, but you can go through the same process using the command line setup explained in the documentation I’ve linked. Your choice you can wait for 4.8 or dive into the command line setup.

As for BP only way of accessing the current culture… I don’t believe there is an option. I’ll add a ticket to get it exposed to blueprints. I’m unsure if this will make it into the 4.8 release though.

Thats good. I will stick with the current version and do the cmd line setup.
I am bit confused where exactly I can use the code in cmd line setup.

Defaultgame.ini maybe?

I am still not getting any idea how to localize it. I did able to localize on a PC project but getting some error in Mobile content projects. Can you plz give some input on how to use C++ code [FInternationalization::Get().GetCurrentCulture();] to fetch the mobile language.

Can we use C++ for a Blueprint project?

I have my project in all BP and I am not sure where exactly I can use this code on C++. Any tutorial regarding this would be appreciable.

Thank you so much!