Ways to build a multilingual App?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 216
- Joined: Wed Feb 27, 2013 9:04 pm
Ways to build a multilingual App?
Hi there,
what kind of ways are out there to build a multilingual App in LC?
what kind of ways are out there to build a multilingual App in LC?
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Ways to build a multilingual App?
Not sure I really know what I am talking about here.
If I were writing a application for French, I would have to make sure that interface elements, such as the "answer" dialog, had things like "Annuler" instead of "Cancel". Is this the sort of thing you mean?
It is straightforward to use different character sets for different countries. Of course, you have to program in english. As an American, I see that as only natural.
Craig Newman
If I were writing a application for French, I would have to make sure that interface elements, such as the "answer" dialog, had things like "Annuler" instead of "Cancel". Is this the sort of thing you mean?
It is straightforward to use different character sets for different countries. Of course, you have to program in english. As an American, I see that as only natural.
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Ways to build a multilingual App?
One common way is to create a custom property set for each language. Each property set has keys in English with values in the other language. The controls in the stack should have names in English. When the stack opens, or before each card opens, the script loops through all the controls and sets their labels to the value in the appropriate custom property set.
That allows you to use a single English name for every control while displaying a different language to the user on screen.
That allows you to use a single English name for every control while displaying a different language to the user on screen.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Ways to build a multilingual App?
Jacque.
Surely a sound approach. Or maybe just one property, holding an array, like:
translator["French"]["EnglishLabel1"]["FrenchLabel1"]
translator["French"]["EnglishLabel2"]["FrenchLabel2"]
translator["Spanish"]["EnglishLabel1"]["SpanishLabel1"]
translator["Spanish"]["EnglishLabel2"]["SpanishLabel2"]
etc.
Craig
Surely a sound approach. Or maybe just one property, holding an array, like:
translator["French"]["EnglishLabel1"]["FrenchLabel1"]
translator["French"]["EnglishLabel2"]["FrenchLabel2"]
translator["Spanish"]["EnglishLabel1"]["SpanishLabel1"]
translator["Spanish"]["EnglishLabel2"]["SpanishLabel2"]
etc.
Craig
Last edited by dunbarx on Sat Feb 22, 2014 1:56 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Ways to build a multilingual App?
Sure, that would work too. One advantage of using different property sets though is that you can just set the property set once at startup and then use a bit simpler syntax:
instead of:
set the label of btn "File" of grp "menu" to the translator[thisLanguage]["File"][cFile] of this stack
Code: Select all
set the customPropertySet of this stack to thisLanguage -- only done once at startup, then thereafter:
set the label of btn "File" of grp "menu" to the cFile of this stack
set the label of btn "File" of grp "menu" to the translator[thisLanguage]["File"][cFile] of this stack
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 216
- Joined: Wed Feb 27, 2013 9:04 pm
Re: Ways to build a multilingual App?
Could someone please upload a sample stack for me please?
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Ways to build a multilingual App?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Ways to build a multilingual App?
Hi All,
Url post above doesn't work.
Here is a little stack with some scripts for translate label, menuitems and ask/answer dialogs between English/French. Best regards
Jean-Marc
Url post above doesn't work.
Here is a little stack with some scripts for translate label, menuitems and ask/answer dialogs between English/French. Best regards
Jean-Marc
https://alternatic.ch
Re: Ways to build a multilingual App?
Here the correct URL to my stack:
http://forums.livecode.com/viewtopic.php??f=7&t=15072
http://forums.livecode.com/viewtopic.php??f=7&t=15072
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Ways to build a multilingual App?
Salut Klaus,
Thank you
I was able to open it after I replace ".mc" with ".livecode" in file name and it works
Best
Jean-Marc
Thank you
I was able to open it after I replace ".mc" with ".livecode" in file name and it works
Best
Jean-Marc
https://alternatic.ch
Re: Ways to build a multilingual App?
It also works without renaming when you select "All files" in the popup below the filelist!
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Ways to build a multilingual App?
Here is a new version "stChangeLangage001".
It use the same way as first and it is able to always return handler name in English for each langage
It use the same way as first and it is able to always return handler name in English for each langage
https://alternatic.ch