Add Localization into binary ?
Hello,
Is possible to make a MultiLanguage App with severals localizations ? (English,French ..
Thanks
Julien
2 Answers
-
I used a separate include file with all the strings in arrays.
For example,
Welcome = ["English","French","Chinese"]
Then, I used a app property names lang_id, which can be set to 0,1 or 2.
So, for every instance of string display,
I used something like Display Welcome[lang_id]
-
We're doing a similar thing as Peter in Golingo.
However we're using one sqlite database per language, and only load the current language's database.This database is basically a key-value pair storage comparable to:
fre.js
// French var t = { hi: 'salut', bye: 'au revoir' }
eng.js
// English var t = { hi: 'hi', bye: 'bye' }
Then you could run
Ti.include(lang + '.js')
And use your translations likeTi.UI.createLabel({ text: t.hi });
which would give you a label reading either 'hi' or 'salut' depending on wheter the lang variable is 'eng' or 'fre'./Jacob