I downloaded Corona today and I’m very suprised that Corona has no support for localization!
Perhaps I’m wrong and I have just found nothing in the docs and the forum but I’ve looked in the example app “HelloWorldLocalized” and this is NOT what I call localization support.
Before buying a subscription I have to code a prototype an localization is essential. I still want to give corona a chance and coded localiatzion.lua:
module(..., package.seeall)
local localizedText =
{
["tabMainView"] =
{
["en"] = "no",
["de"] = "yes"
},
["tabSettings"] =
{
["en"] = "test123",
["de"] = "test234"
}
}
function GetLocalizedString(stringName)
local language = "de"
--local os = system.getInfo("platformName")
--if os == "Android" then
-- print( "system.getPreference is not implemented on Android yet" )
--else
-- language = system.getPreference( "ui", "language" )
--end
return localizedText[stringName][language]
end
Some questions to this code and localization with Corona in general:
- Is my approach reasonable?
- Will this work on iOS and Android? The example code says that this does not work with Android.
- The commented out text does not work in the simulator. language always contains the value “1031”. Is this an issue with the simulator? [import]uid: 74852 topic_id: 20649 reply_id: 320649[/import]
[import]uid: 52491 topic_id: 20649 reply_id: 81239[/import]