Multi language application

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
vince
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Wed Aug 29, 2012 8:51 pm

Multi language application

Post by vince » Wed Aug 29, 2012 8:57 pm

I'm currently evaluating Livecode and i can't seem to find a lot of information on how one would create a multi-language application where the complete user interface is available in multiple languages. Is this possible with Livecode and if so how? Is it possible to have end users provide extra translations in an easy way?

To me this seems like an obvious functionality of a modern programming language, so i'm hoping i have just missed the information about it in the documentation :wink:

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Multi language application

Post by FourthWorld » Wed Aug 29, 2012 9:36 pm

Most objects in LiveCode have a label property which is independent of the object's name, allowing you to write code to take advantage of the mnemonic value of the name while dynamically changing the label, such as for multiple languages.

Menu items support a tag element which allows you to have a single consistent argument sent to the menuPick handler regardless of what the actual menu item label shows, which is also particularly useful for multilingual support.

So while there's no built-in automated support for localization per se, the necessary elements for making localized apps are available and not difficult to work with.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

vince
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Wed Aug 29, 2012 8:51 pm

Re: Multi language application

Post by vince » Wed Aug 29, 2012 10:02 pm

thanks Richard for your prompt reply!

I find it strange that runrev hasn't supplied a demonstration project or documentation to demonstrate how this should happen (that i could find). I understand that it is at least possible from your answer which is good to know. But i still don't feel really comfortable about making a multi language app (win + mac) and would have expected more on this subject from runrev.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Multi language application

Post by mwieder » Wed Aug 29, 2012 10:18 pm

I don't know of any "modern programming language" that supports i18n natively. LiveCode's support is essentially the same as java's, and can be easy to implement, even if it's not built in.

1. create resources for the i18n strings

Code: Select all

set the uLocalization["English"]["warning"] of this stack to "Warning"
set the uLocalization["Espanol"]["warning"] of this stack to "Peligro"
2. utilize switch statements to change locales or create a function to do the work

Code: Select all

function localize pLanguage, pString
   return the uLocalization[pLanguage][pString] of this stack
end localize

vince
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Wed Aug 29, 2012 8:51 pm

Re: Multi language application

Post by vince » Thu Aug 30, 2012 8:17 pm

Well for example for Qt there's Qt Linguist (Google it as i can't post links yet).

But anyway, reading from your experiences i understand that multi language applications are perfectly doable in LC so that's enough assurance for now. It would just be nice if runrev themselves would offer more possibilities and documentation. Also when developing for mobile devices you see a lot of multi language apps so the need for this is only getting bigger.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Multi language application

Post by mwieder » Thu Aug 30, 2012 9:05 pm

Thanks for the er... link. I wasn't aware of that one.

Qt, of course, is an application framework rather than a "programming language", coding is done in C++, but it's nice that they've bundled the translator into the framework.
Setting it up to use (http://doc.trolltech.com/4.0/linguist-programmers.html) looks about the same in Qt as it does anywhere else:

load the translator framework
instantiate a translator object
load the locale strings
use the strings

It's much the same in LiveCode or anything else, you just have to do a bit more because there's no standard translator module built in for you. My hope was that LiveCode's profiles would work this way, but they don't.

Post Reply