Index


Using LangC tool

As you can see in examples included in this documentation scripts doesn't contains plain text but texts beginning with "translateSomething". This strings are "keys" for language-dependent strings which are stored in '*.lan' files in 'Language' directory ('language.wd' file). Game takes this key finds value for it and uses translated string. If you want to distribute your scripts it's good idea to use the same way of using strings. Also you must use it to display f.e. formatted briefings in campaigns. LangC.exe  is the tool  used to create '*.lan' files. LangC requires three types of files: '*.idx' files with only "translateSomething" list, '*.txt' files with "translateSomething" keys and its values and '*.ini' file - configuration file for LangC. '*.lan' file created by LangC should be copied to Language directory, and can be places in the same '*.wd' file with scripts (or in separated '*.wd' file if will be translated later to other language). Don't create language.lan file becouse it's standard Earth file.

Example of using LangC:
LangC.exe C:\Games\EarthLang\MyLang.ini
copy C:\Games\EarthLang\MyLang.lan C:\Games\Earth\Language
MyLang.ini contents:
[LangC] - must be
Output="MyLang" - name of  '*.lan'  file
Index="C:\Games\EarthLang\" - directory which contains '*.idx' files for 'Input*' files
Input0="MyLang1" - '*.txt' file name
Input1="MyLang2"
MyLang1.idx contents:
translateMyCampaign
translateParams
MyLang2.idx contents:
translateBriefing1
translateGoal1
MyLang1.txt contents:
item translateMyCampaign "My campaign title"
//text below is example of text for functions with multi-parameters like AddBriefing or AddGoal
//you must pass the same count of parameters (2 here) (strings or numbers) to this function
item translateParams "First param is <%0>, and second is <%1>"
MyLang2.txt contents:
//you can make comments like this one
//example of preformatted text below:
message formated translateBriefing1
{
This is multi-line
        preformatted text
(without any quotas)
}
//multi-spaces below splited to one space
item translateGoal1 "Earn         <%0>      CR"