I am in the process of releasing my new game “Feather” on the iOS App Store and I wanted to release it in various languages, first of which will be Spanish.
After reading these various posts across the web and this forum, I’m halfway there.
http://forums.coronalabs.com/topic/12191-language-localization-foreign-language-apps-build-settings/
http://stackoverflow.com/questions/12146750/where-cfbundlename-is-being-used
http://forums.coronalabs.com/topic/38972-does-corona-support-app-name-localization
http://lauratallardy.com/app-localization-made-easy/
In my app, I use this code to test for alternate languages:
\_G.language = system.getPreference( "ui", "language" ) if string.find( \_G.language, "es%-" ) ~= nil then \_G.language = "es" end if string.find( \_G.language, "en%-" ) ~= nil then \_G.language = "en" end -- failsafe language mode if \_G.language ~= "es" and \_G.language ~= "en" then \_G.language = "en" end
I had to add the string.find statements because iOS once returned es-MX for Español (Mexíco), and I figured it could also return en-GB for Great Britain.
With _G.language variable properly set, I am able use a statement like logo = display.newImageRect( “logo_” … _G.language … “.png” ) to access logo_en.png and logo_es.png for the localized graphic titles, for example.
Ok, so that’s settled. Now, in my build.settings file, I’ve added the CFBundleLocalizations section:
settings = { plugins = { ... }, orientation = { ... }, iphone = { plist = { MinimumOSVersion = "7.0", UIPrerenderedIcon = true, UIStatusBarHidden = true, ... CFBundleLocalizations = { "es", "en", } }, }, ... }
And I created both es.lproj and en.lproj root folders, both with InfoPlist.strings files. The InfoPlist.strings file in the es.lproj folder contains:
CFBundleDisplayName = “Pluma”; CFBundleName = “Pluma”;
Now, when I compile and place on my iPhone, it says Feather under the app’s icon, not Pluma when I change the Language settings to Español or Español (Mexíco). I’ve even tried creating another root folder called es-MX.lproj with the same file, but still the app remains as Feather. What am I doing wrong?