Translating Lgi Applications
Introduction
Lgi now supports cross-platform multi-language for all applications that choose to use it, however at this time Scribe and i.Ftp are the only applications taking advantage of the translation capabilities of Lgi.
Nitty-gritty
Well, how do you actually create new translations?

To start with you will need to download the latest version of the application (whatever that is) so that you have an up to date resource file. You should also download a copy of LgiRes, the editor for the resource file.

The language data is stored in the .lr8 file that came with the application. You can open this up in a text editor or LgiRes and have a browse through the raw UI information. Worst comes to worst you can edit this directly to add a language but it's probably going to be easier to use LgiRes, the custom application for editing .lr8 files. I'm telling you this so that you to be aware of the second option if you have trouble with LgiRes.

After adding the translation to the .lr8 file you can start the application to see your changes. If your computers language is set to whatever language you are adding you should see the new text in the dialogs etc. But if your settings are just english that you can change the language inside the program. For Scribe use Options -> Appearence and then restart the application. For i.Ftp use the Language menu.

Editing the lr8 file using LgiRes
Start LgiRes. Open the lr8 file and wait for it to load.

You can hide and show the various languages inside the lr8 file using View -> Show Languages menu. Also the View menu can change the languages shown in lists and dialogs:

Show Languages
(click to enlarge)

Scroll down to the string groups in the tree of resources:

Click on each string group, and then click the yellow bordered 'L' to add a language to the group, select the language you are going to translate to and click Ok.

Now you have an extra column labelled with the language you just added. You can now select each string in the list and add the translation of the text in the edit boxes in the lower left part of the window.

As you go save the file to app2.lr8, app3.lr8 every 15 minutes or so. That you have a history of backups that you can revert to.

If a string doesn't have a direct translation, ie the "..." strings, just leave it. The program will default back to english where there is no translated string. If your translation is the same as the english then LgiRes will discard it when it saves the file, this is just to save space.

After all the strings are translated, go down the the menu "ID_MENU".

Add your language to the menu by clicking the yellow bordered "L":

This way you can add a new language. Then go through each item in the tree and fill out the translations of the menu items.

When the translation is finished, you can test your work by starting the application with the command line shown above and your lang code to see the new translation in action. Mind you you'll have to back up the original lr8 file and copy in your edited version for this to work.

When your happy with the translation, send the lr8 file to me so that I can include it in the next version of the application. That way everyone benifits from your work.

When new versions of the software are released there are often new bits of user interface and strings, which need translating too. The best way to find untranslated strings is to use Edit -> Find and select the "Find missing translation in this language" option with your translation's language selected.

Editing the lr8 file directly
Firstly you must use a text editor that can handle utf-8 to edit the lr8 file.

It's not as hard as it sounds. Really! Basically at the top of the file theres lots of string definitions which associate a numerical value with one or more strings in different languages. This allows the one user interface element to have different text without being defined twice. Unlike in WIN32 resource scripts where each dialog is defined differently for different languages and updating the user interface means opening every version of the dialog and making your change.

Anyway back to the task of adding a translation. The initial strings look something like this:

<string Ref=2 Cid=1112 Define="IDC_SOCKS5"
	en="Optional SOCKS 5 Proxy Settings"
	fr="Paramtres Proxy socks5"
	it="Settaggi Proxy SOCKS5"
	cs="Voliteln SOCKS 5 proxy nastaven"/>
This is standard XML markup, so all the XML formatting rules apply. The line breaks and attributes are not sensitive to whitespace. However you can put a new line character in a string using '\n'. You'll see that some strings have '\n' in them, and you should try and include those in your translation.

Ok the initial "String" says that this tag is a string, and the "Ref" is a globally unique value to link this string with an element in the user interface, defined later in the file. The "Define" the value is use in my C++ code to reference the string or user interface element. So changing that won't effect anything. The interesting part is the language attributes. These define the text for different languages, in this example "en" is the code for english and "fr" is the code for french. So this element has 4 languages. To add a translation to spanish for instance you would add an attribute like this:

<string Ref=2 Cid=1112 Define="IDC_SOCKS5"
	en="Optional SOCKS 5 Proxy Settings"
	fr="Paramtres Proxy socks5"
	it="Settaggi Proxy SOCKS5"
	cs="Voliteln SOCKS 5 proxy nastaven"
	es="Parmetros opc. Proxy SOCKS5"/>
("es" being the language code for spanish)

The language codes are defined below. All text has to be in utf-8 so you must use a utf-8 capable editor otherwise the data will be corrupted.

Language Id
Abkhazianab
Afaraa
Afrikaansaf
Albaniansq
Amharicam
Arabicar
Armenianhy
Assameseas
Aymaraay
Azerbaijaniaz
Belarusianbe
Bashkirba
Basqueeu
Bengalibn
Bhutanidz
Biharibh
Bislamabi
Bretonbr
Bosnianbs
Brazilian Portuguesept_br
Bulgarianbg
Burmesemy
Cambodiankm
Catalanca
Chinesezh
Chinese Simplifiedzh_cn
Chinese Traditionalzh_tw
Corsicanco
Croatianhr
Czechcs
Danishda
Dutchnl
Englishen
Esperantoeo
Estonianet
Faeroesefo
Farsifa
Fijifj
Finnishfi
Frenchfr
Frisianfy
Galiciangl
Gaelicgd
Gaelicgv
Georgianka
Germande
Greekel
Greenlandickl
Guaranign
Gujaratigu
Hausaha
Hebrewhe
Hindihi
Hungarianhu
Icelandicis
Indonesianid
Interlinguaia
Interlingueie
Inuktitutiu
Inupiakik
Irishga
Italianit
Japaneseja
Javanesejv
Kannadakn
Kashmiriks
Kazakhkk
Kinyarwandarw
Kirghizky
Kirundirn
Koreanko
Kurdishku
Laothianlo
Latinla
Latvianlv
Limburgishli
Lingalaln
Lithuanianlt
Lugandalg
Macedonianmk
Malagasymg
Malayms
Malayalamml
Maltesemt
Maorimi
Marathimr
Moldavianmo
Mongolianmn
Nauruna
Nepaline
Norwegianno
Occitanoc
Oriyaor
Oromoom
Pashtops
Polishpl
Portuguesept
Punjabipa
Quechuaqu
Rhaeto-Romancerm
Romanianro
Runyakitarary
Russianru
Samoansm
Sangrosg
Sanskritsa
Serbiansr
Serbo-Croatiansh
Sesothost
Setswanatn
Shonasn
Sindhisd
Sinhalesesi
Siswatiss
Slovaksk
Sloveniansl
Somaliso
Spanishes
Sundanesesu
Swahilisw
Swedishsv
Tagalogtl
Tajiktg
Tamilta
Tatartt
Telugute
Thaith
Tibetanbo
Tigrinyati
Tongato
Tsongats
Turkishtr
Turkmentk
Twitw
Uighurug
Ukrainianuk
Urduur
Uzbekuz
Vietnamesevi
Volap?kvo
Welshcy
Wolofwo
Xhosaxh
Yiddishyi
Yorubayo
Zuluzu