Localization within an iphone app made in unity

On the ADC they tell us we can make the store pages localized by filling out our data in multiple languages, but they also clearly mention that the localization in the app should be all in 1 application.

Is this possible in the current Unity Iphone build ?

For example, can I make an app which is automatically capable of sensing which local language is active on the iphone ?

If possible → How ?

Kind regards,
Bart

We’re having the same interrogation here at Frogames.

Does anyone managed to push a Unity iPhone app with localized support?

Is there a way to know which language the user iPhone is running?

You could create localized strings in XCode like you do normally, and then pass them into Unity via PlayerPrefs. So inside the app delegate before Unity is started:

NSString *s = NSLocalizedString(@"Player one", @"Player One");
[[NSUserDefaults sharedDefaults] setObject: s forKey: @"Player one"];

Or, you can map the strings to localized equivalents inside Unity code, and just pass in the current language. I’ve never tried it, but the docs say you can get the current language like this:

NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
NSArray* languages = [defs objectForKey:@"AppleLanguages"];
NSString* preferredLang = [languages objectAtIndex:0];
[[NSUserDefaults sharedDefaults] setObject: preferredLang forKey: @"language"];

Thanks bliprob! :slight_smile:
I’ll try the second method.

Does anyone know if it’s something that will be work on on a futur version of Unity iPhone? It would be interesting to have an Application.preferredLang variable.

has anyone succesfully implemented this?
How and where needs this code to be placed?
Where can I find the above mentioned documentation about this?

The last line should be

[[NSUserDefaults standardUserDefaults] setObject: preferredLang forKey: @"language"];

Put it somewhere before the line that launches Unity.

–Eric

Thanks for the tipp! This works fine!
But the changes I make to the xCode Project are overwritten when I build the project in unity.
Can I circumwent that somehow?

EDIT:
I a now using PostProcessBuildPlayer to copy a modified AppController.mm to the xCode Project after the Unity-Build is done. Works fine… :slight_smile:

alternatively you can just alter the trampoline in unity iphone.app

Please, can you explain what you mean by “alter the trampoline”?

Hi!

We integrated localization in English, French, German, Italian and Spanish for our Predators game.

We did all this by writing a simple C# class and accessing it in Unity.

We just have one problem: The iTunes Appstore description shows only ‘English’ as the supported language.

Here’s a screenshot:

Do you know of any settings on the Xcode side, to enable the other 4 languages, so they’d show up on iTunes? (French, German, Italian Spanish)
There were no hidden checkboxes when uploading the app through iTunes Connect :?

Thanks a lot,
Bogdan

1 Like

Can somebody explain more detailed for Xcode n00bs how this works? (what is the line that starts unity? And how do I access the language from inside unity?) And does it work with iphone basic?

@BogdanDude I think you have to set the language inside a plist file to be shown in the AppStore (as written somewhere in the apple documentation)

I did a quick search on Google, but I didn’t find any info.plist settings for showing those languages.

If you know what those settings are, please let me know.

Thanks a lot!

dunno maybe this helps?

http://developer.apple.com/iphone/library/documentation/MacOSX/Conceptual/BPInternational/BPInternational.pdf

Anyway still trying to get that working with iphone basic for an already finished update, the enhancement pack makes audio problems with multitasking so I hope to be able to avoid it. Can someone please take me by the hand and explain how to do it? :sweat_smile:

You need something like this, iOS Localization Guide for Multilingual iPhone Apps to get all the languages availables on the itunes description.

What I did for Realmaze3D was to (in XCode) select MainWindow.xib, get info, make the file localizable, then add the two-letter country codes for the languages I had. As long as something is marked as localized like this, then it shows up in iTunes properly, regardless of whether you actually do anything else in XCode (the actual localization in my case was done in Unity).

–Eric

Thanks a lot guys! That was really easy :slight_smile:
Now let’s see if they actually turn up in iTunes :slight_smile:

I still don’t get it to work with iphone basic and playerprefs :frowning:

No one who can help?

Bump :sweat_smile:

Really no one with a solution for javascript and iphone basic?