%AutoLang%      Author: Siegfried     Show Routine Code 


Version: 1  -  Date: 2007-02-15

 

Example calls:
%AUTOLANG%
%AUTOLANG% "AnyName.dat"

Remarks:
Automatically defines the %LANG% variable from a match found in DATs\LANG.txt to the system language.
Language defs in DATs\LANG.txt  or DATs\*.dat

NOTE:

LANG.txt has a new format (layout) and is not compatible with the old autoHelp LANG.ini.

A existing old format DATs\LANG.ini will automatically be converted to the new format of DATs\LANG.txt. This may apply if you convert an existing AutoHelp plugin to the PlugLab format while you have to do an update. Just drop the LANG.ini into the folder "DATs" and make sure there is no LANG.txt in there already. When you configure the plugin, LANG.ini is read out and the settings in there are applied to a new format LANG.txt. The old LANG.ini is renamed to Old-LANG.ini  and moved to the root of the plugin. You may then delete it.

Example in LANG.txt:

**09_English==eng
**07_German=deu
**0c_French=fra

Will automatically set the variable %LANG% to "deu" or "fra" for german or french systems and "eng" for english systems.
For any other system language, the user will be prompted with a selection of all available languages to make a choice.

%AUTOLANG% always uses DATs\LANG.txt


%AUTOLANG% "AnyName.dat"

... uses the specified file as a language definition. You would only use this for a second call on AutoLang within the same autoHelp.cmd, if you have two seperate localisations to do in the same script. You may have to preserve the first definition of %LANG% with something like set LANG1=%LANG%, to avoid that it gets overwritten by the second call if you need both values throughout the script.


For testing localisations you can force a specific language (simulate a different OSlang for the AutoLang routine).

Add something like this to the variable definition section of your AutoHelp.cmd while you are testing:

:: 1009_English_Canadian=Canadian
set AutoLangID=1009

This allows you to test your localisation of a plugin. The codes of the languages are in SCRIPS\DATs\LANG.txt.

Donīt forget to remove that entry after testing, or AutoLang will not detect the userīs system language.

 

Below is an example of a LANG.txt

Note, that e.g. english comes in various flavours. All language codes are 4-digets with the first two being the sublanguage and the last two the main language code.

If you are not sure about the flavour of a lang file or if you are sure, that the flavour doesnīt matter, then use the "**09_English=" as it will then automatically be used for all sub-languages (handled for all sub-languages like an exact match). If e.g. you have a lang file for the "United_Kingdom" sub and you are sure it matters, put it under "0809_English_United_Kingdom=". This will then only auto-select it for users with OSlang "0809". All others (including those with e.g. the "United_States" sub) will get the selection prompt to make their own choice.

Using the %LANG% variable:

-Assuming the program has various language files like

"%PROGPATH%\Language\English.lng"

"%PROGPATH%\Language\German.lng"

"%PROGPATH%\Language\Czech.lng" etc.

 

-Then this whould copy the right one to the plugin:

copy "%PROGPATH%\Language\%LANG%.lng" "Files\Language\%LANG%.lng"

 

In essence: AutoLang maps the language dependant component of a filename or INF-entry to the lang code of the OS.

-The fact that there is an entry behing a language in LANG.txt indicates that a language file exist.

-The entry itself is the language component relevant for that language.

 

Example for LANG.txt

**09_English=English
0409_English_United_States=
0809_English_United_Kingdom=
0c09_English_Australian=
1009_English_Canadian=
1409_English_New_Zealand=
1809_English_Irish=
1c09_English_South_Africa=
2009_English_Jamaica=
2409_English_Caribbean=
2809_English_Belize=
2c09_English_Trinidad=
3009_English_Zimbabwe=
3409_English_Philippines=

**36_Afrikaans=

**1c_Albanian=

**01_Arabic=
0401_Arabic_Saudi_Arabia=
0801_Arabic_Iraq=
0c01_Arabic_Egypt=
1001_Arabic_Libya=
1401_Arabic_Algeria=
1801_Arabic_Morocco=
1c01_Arabic_Tunisia=
2001_Arabic_Oman=
2401_Arabic_Yemen=
2801_Arabic_Syria=
2c01_Arabic_Jordan=
3001_Arabic_Lebanon=
3401_Arabic_Kuwait=
3801_Arabic_UAE=
3c01_Arabic_Bahrain=
4001_Arabic_Qatar=

**2b_Armenian=

**2c_Azeri=
042c_Azeri_Latin=
082c_Azeri_Cyrillic=

**2d_Basque=

**23_Belarusian=

**02_Bulgarian=

**03_Catalan=Catalan_Valencian

**04_Chinese=Chinese_BIG5
0404_Chinese_Taiwan=
0804_Chinese_PRC=
0c04_Chinese_Hong_Kong=
1004_Chinese_Singapore=
1404_Chinese_Macau=

**1a_Croatian=

**05_Czech=Czech

**06_Danish=

**13_Dutch=Nederlands
0413_Dutch_Standard=
0813_Dutch_Belgian=

**25_Estonian=

**38_Faeroese=

**29_Farsi=

**0b_Finnish=

**0c_French=
040c_French_Standard=
080c_French_Belgian=
0c0c_French_Canadian=
100c_French_Swiss=
140c_French_Luxembourg=
180c_French_Monaco=

**37_Georgian=

**07_German=Deutsch
0407_German_Standard=
0807_German_Swiss=
0c07_German_Austrian=
1007_German_Luxembourg=
1407_German_Liechtenstei=

**08_Greek=

**0d_Hebrew=

**39_Hindi=

**0e_Hungarian=

**0f_Icelandic=

**21_Indonesian=

**10_Italian=Italiano
0410_Italian_Standard=
0810_Italian_Swiss=

**11_Japanese=

**3f_Kazakh=

**57_Konkani=

**12_Korean=

**26_Latvian=

**27_Lithuanian=

**2f_Macedonian=Macedonian

**3e_Malay=
043e_Malay_Malaysia=
083e_Malay_Brunei_Darussalam=

**14_Norwegian=
0414_Norwegian_Bokmal=
0814_Norwegian_Nynorsk=

**15_Polish=Polski

**16_Portuguese=Portuguese
0416_Portuguese_Brazilian=
0816_Portuguese_Standard=

**18_Romanian=

**19_Russian=Russian

**4f_Sanskrit=

**1a_Serbian=
081a_Serbian_Latin=
0c1a_Serbian_Cyrillic=

**1b_Slovak=

**24_Slovenian=Slovenski

**0a_Spanish=Espaäol
040a_Spanish_Traditional_Sort=
080a_Spanish_Mexican=
0c0a_Spanish_Modern_Sort=
100a_Spanish_Guatemala=
140a_Spanish_Costa_Rica=
180a_Spanish_Panama=
1c0a_Spanish_Dominican_Republic=
200a_Spanish_Venezuela=
240a_Spanish_Colombia=
280a_Spanish_Peru=
2c0a_Spanish_Argentina=
300a_Spanish_Ecuador=
340a_Spanish_Chile=
380a_Spanish_Uruguay=
3c0a_Spanish_Paraguay=
400a_Spanish_Bolivia=
440a_Spanish_El_Salvador=
480a_Spanish_Honduras=
4c0a_Spanish_Nicaragua=
500a_Spanish_Puerto_Rico=

**41_Swahili=

**1d_Swedish=Svenska
041d_Swedish=
081d_Swedish_Finland=

**49_Tamil=

**44_Tatar=

**1e_Thai=

**1f_Turkish=

**22_Ukrainian=

**20_Urdu=

**43_Uzbek=
0443_Uzbek_Latin=
0843_Uzbek_Cyrillic=

***2a_Vietnamese=