Page 1 of 1

Localization Example

Posted: Thu Sep 12, 2013 10:33 am
by elanorb
Hi

As requested here is a very simple example of localiztion. The stack reads the file of transaltions into an array and allows the user to switch the selected language. The unicodeText property of a label field and unicodeLabel property of a button are used to display the text correctly.

The strings.txt file is a UTF8 file which is why the byte order mark needs to be removed, the UTF8 text also needs to be converted to unicode using the uniEncode function before it can be used to set the unicodeText or unicodeLabel property.

Please let me know if you have any questions.

Kind regards

Elanor

Re: Localization Example

Posted: Thu Sep 12, 2013 12:40 pm
by bangkok
Nice example.

I would suggest you to expand the script, in order to deal with many objects, on many cards. The idea is to avoid to maintain the list of objects in the selectLanguage script .

-a custom property into the object : to be translated, yes or no

-in the file, add the ID of the object, in order to make the link with translations, rather than the name of the object

-3 loops, to browse all cards, all objects (fields and buttons)

See a quick modification in the stack attached.