How to build a LOCALIZED app/game?

Hi Devs,

I am searching about how to make the localization of my app with Corona but got nothing until now. So I ask help for you guys because I have no idea how to do it.

I want to have my app localized about 3 or 4 languages (Portuguese, English, French and Spanish).

So as I have Zer0 idea on how to get it done, I would be glad getting a “hand” of someone here in the communty. For example, I have a vague idea that I have to set the CFBundleLocalizations in the config.lua files but just it! :\ And so where goes my typed translations, etc.

Sorry guys but how to get it done at all?

[en] Thanks!
[pt-br] Obrigado!
[es] Gracias!
[fr] Merci!

Rodrigo. :-] [import]uid: 89165 topic_id: 18499 reply_id: 318499[/import]

Not sure if this is useful at all to you but a while ago I created a simple module for multiple translations called Rosetta - http://grahamranson.co.uk/lib.php?id=3

It doesn’t use and of the CFBundleLocalizations stuff though so not sure how helpful it would be for you. [import]uid: 5833 topic_id: 18499 reply_id: 70923[/import]

Hi Graham.

Thank you for the reply! Any one is welcome for sure.

So about the localization, I will look at your lib. If it does get an app “localized” it is just what I am looking for.

PS: I`ve mentioned about “CFBundleLocalizations” but honestly I have no idea how to use that also. I said it only for people know what am talking about. :slight_smile:

PS: My goal is to have the app localized only. And I wish an easy way too.
Cheers!
Rodrigo.
[import]uid: 89165 topic_id: 18499 reply_id: 70925[/import]

Hope it does help :slight_smile: [import]uid: 5833 topic_id: 18499 reply_id: 71036[/import]

Hey Rodrigo,

Check out www.tethras.com for a simple, fast and efficient human translation service that specializes in app localization.

Lee [import]uid: 108583 topic_id: 18499 reply_id: 71054[/import]

For my projects I have a language-data class, which returns different strings based on language, via simple get functions and strings/ language arrays, with data in the form of e.g.

v['newsDialogHeader'] = {  
 en = 'News',  
 de = 'Nachricht'}  

… and also a translatedImages array, e.g.:

app.translatedImages['de'] = {  
 {filename = 'intro'},  
 {filename = 'readyButton'}  
 }  

Above means that for the German version, the intro file is not in the images root, but in a sub-folder “de”. I can additionally change the image size here by providing width and height parameters.

To get the language abbreviation, I’m using

function appGetLanguage()  
 local language = system.getPreference('ui', 'language') -- e.g.zh-Hans -\> zh  
 local abbreviationLength = 2  
 if string.len(language) \>= abbreviationLength then  
 language = string.sub(language, 1, abbreviationLength)  
 end  
 return language  
end  

and then

app.defaultLanguage = 'en'  
app.language = appGetLanguage()  

Hope this helps! [import]uid: 10284 topic_id: 18499 reply_id: 71258[/import]

Hello guys,

Firstly thanks for all the help anyway! :slight_smile:

@GrahanRanson, Ive looked at your lib "Rosetta" and I think that is without doubt an awesome class for app-translation. As it was the first "tip" about my topics question I`ll stick with that (although I did not “study” the lib well until now because I am solving other things in the app code). Any problem I get with I can report here also.

@IKelly thanks for the link. I did not know about that and honestly I`ve looked quickly there and I think the prices are not so bad and the service looks like would be good. Anyway I am going to keep it bookmarked here as well. :slight_smile:

@Phillip, thank you very much for the given localization code example! It`s just great. One more way to get the localization done. Thank you.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 18499 reply_id: 71320[/import]

There are certainly many ways to get this sort of thing done, Rosetta is just what I needed at the time and then I figured I’d release it in case anyone else wanted it.

As was done in Philipp’s code, Rosetta could also be used to store things other than text translations, it could also include filenames etc for the different app versions based on what language the user has set. [import]uid: 5833 topic_id: 18499 reply_id: 71571[/import]

Graham,

Thanks! By the way if Rosetta can get my app localized (what for me means that if I translated for 3 languages (es, en, pt) the user in Portugal/Brazil will see the app in their native language (pt), if the user is from USA it will see the app in English…etc. So if Rosetta can do this, it is all I need for now.

Sure having possibility to store images, etc as well would be even better but its not for me right now. :slight_smile:
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 18499 reply_id: 71575[/import]

Yep that is precisely what Rosetta can do. You just need to create all the translation files then wherever you have in your code that you are displaying some kind of string you just need to retrieve that string using the helper functions in Rosetta.

You will need to put in the code that actually decides what language should be displayed though as Rosetta won’t try to guess for you. You could either try to do this pragmatically using “system.getPreference( ‘ui’ , ‘language’ )” or you could create a screen with some separate flag buttons on allowing the player to choose their preferred language. [import]uid: 5833 topic_id: 18499 reply_id: 71581[/import]

"You could either try to do this pragmatically using “system.getPreference( ‘ui’ , ‘language’ )” or you could create a screen with some separate flag buttons on allowing the player to choose their preferred language."
-Exactly the second option in my mind right now! Firstly because using the “flags” way it would allow users to get their preferred language as we know many of us do speak more than one language as well.

But hey Graham, the first option (the “automatic” one) that choose the language by the system info would be implemented how? Do you have any sample code about it working?
Thanks for the “tips”!

Rodrigo, [import]uid: 89165 topic_id: 18499 reply_id: 71603[/import]

I don’t have any full code however in Philipp’s post above he has supplied a function to get an abbreviated version of the devices language, you could then name your language files after that abbreviation in order to access the correct one. [import]uid: 5833 topic_id: 18499 reply_id: 71608[/import]

That`s true Graham.

Although I can say I do not know yet exactly how to implement it thats ok by now. Ill start to look into the translations yet.
I`ve aprreciate the anwers as well.

Thanks.
Rodrigo. [import]uid: 89165 topic_id: 18499 reply_id: 71665[/import]