localizing software

Eric Chatonet eric.chatonet at sosmartsoftware.com
Wed Jul 11 03:13:04 CDT 2007

Hi Mark,

Le 10 juil. 07 à 20:27, Mark Talluto a écrit :

> I need to localize one of my apps for different languages.  I  
> remember talking with Trevor about this at a SoCalRev Meeting a  
> while back.  I just don't remember the details.
> How are you guys handling multi-lang versions of your software?  I  
> remember him storing it in a custom property.  The key was the  
> technique for changing out the text for all the controls in a stack  
> on the fly.  Any pointers would be appreciated.
> Mark Talluto
> -- 
> CANELA Software
> http://www.canelasoftware.com

We are are finishing (public beta) an app in six Roman languages that  
uses more than one thousand strings for each language (labels,  
prompts, contents, etc.).
Each language is stored into an external file with lines in the form  
of <ID><tab><string>
As Ken pointed this out, it's important to store languages strings in  
an external file (you will open it in Excel as a tab/tab/return text  
file) for easy maintenance and translation.
Within the app, the file corresponding to a language is stored into a  
global and the following function is used to get strings:

function GetLanguageString pID
   global gPrefs, gLanguage
   local tStr
   set the itemDel to tab
   put item 2 of line lineOffset(pID,gLanguage) of gLanguage into tStr
   replace "|" with cr in tStr -- cr are put back
   return tStr
end GetLanguageString

And for instance:

on SetGUILanguage
   local tID
    repeat for each item tID in  
     put GetLanguageString(tID) into fld ID tID
   end repeat

Such a method is very fast: changing one hundred labels or fields  
contents (screen locked of course) appears instant for the user.
Strings may include tags (<tag>) that can be replaced on the fly with  
correct values if needed.
Here is an example we use for tooltips:

      if "<tag>" is in tTooltip then replace "<tag>" with the uTag of  
the target in tTooltip
      -- and the uTag of the target is set at mouseEnter

About string lengths according to languages (French, German, Spanish,  
etc.), consider that you will not have problems if allowed width in  
your GUI is 30% more than the width needed for English.
Of course I can't detail here all tricks that make life easy with  
multilingual apps :-)
Feel free to contact me off list.

Best regards from Paris,
Eric Chatonet.
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/

More information about the use-livecode mailing list