Localization Example

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Livecode Staff Member
Livecode Staff Member
Posts: 251
Joined: Fri Feb 24, 2006 9:45 am

Localization Example

Post by elanorb » Thu Sep 12, 2013 10:33 am


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

(1.12 KiB) Downloaded 158 times
Elanor Buchanan
Software Developer

VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 824
Joined: Fri Aug 15, 2008 7:15 am

Re: Localization Example

Post by bangkok » Thu Sep 12, 2013 12:40 pm

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.
(1.7 KiB) Downloaded 151 times

Post Reply

Return to “Summer School 2013”