GAE/Translating

From MegaGlest
Revision as of 06:19, 12 June 2011 by Hofmic (talk) (Created, very large page, might have to find some way to tone down the language's list.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GAE is able to translate every string in a techtree, thus allowing you to make an entire mod multilingual. In addition, it can specify tooltips for each unit (also translatable) which can give a short summary of the unit when their icon is hovered over.

Language files

There are two types of language files that are used to translate mods. The first is the techtree language file, and is located in techtree_name/lang/ and will be named techtree_name_language.lng. For example, in Magitech, it would be named magitech/lang/magitech_en.lng (en is the short code for English, see Language codes below for a full list of the language codes). This file would contain the strings for the resources, faction names, attack type names, and armor type names.

The second language file is located in techtree_name/factions/faction_name/lang/ and would be named faction_name_language.lng. For example, in the Magic faction, it would be named magitech//factions/magic/lang/magic_en.lng. This file contains all of the faction's translations, including unit names, upgrade names, unit and upgrade tooltips, command names, and level names.

Both of these will be explained in detail later on this page (see Techtree language file and Faction language file).

Language codes

As follows is the list of language codes for different languages (or varients of them) which can be used when translating. A language file would end with the code on the left (the text to the right of the equal sign is the full name). Excerpt from langlist.txt:

aa=aa
aa_DJ=aa (DJ)
aa_ER=aa (ER)
aa_ET=aa (ET)
af=Afrikaans
af_ZA=Afrikaans (South Africa)
am=am
am_ET=am (ET)
an=Aragonese
an_ES=Aragonese (Spain)
ar=Arabic
ar_AE=Arabic (United Arab Emirates)
ar_BH=Arabic (Bahrain)
ar_DZ=Arabic (Algeria)
ar_EG=Arabic (Egypt)
ar_IN=Arabic (India)
ar_IQ=Arabic (Iraq)
ar_JO=Arabic (Jordan)
ar_KW=Arabic (Kuwait)
ar_LB=Arabic (Lebanon)
ar_LY=Arabic (Libyan Arab Jamahiriya)
ar_MA=Arabic (Morocco)
ar_OM=Arabic (Oman)
ar_QA=Arabic (Qatar)
ar_SA=Arabic (Saudi Arabia)
ar_SD=Arabic (Sudan)
ar_SY=Arabic (Syrian Arab Republic)
ar_TN=Arabic (Tunisia)
ar_YE=Arabic (Yemen)
as=Assamese
as_IN=Assamese (India)
ast=Asturian
ast_ES=Asturian (Spain)
az=Azeri
az_AZ=Azeri (Azerbaijan)
be=Belarusian
be_BY=Belarusian (Belarus)
ber=Amazigh
ber_DZ=Amazigh (Algeria)
ber_MA=Amazigh (Morocco)
bg=Bulgarian
bg_BG=Bulgarian (Bulgaria)
bn=Bengali
bn=BengaliBangla
bn_BD=BengaliBangla (Bangladesh)
bn_IN=Bengali (India)
bo=Tibetan
bo_CN=Tibetan (P.R. of China)
bo_IN=Tibetan (India)
bokmal=Norwegian, Bokmål
bokmal=Norwegian, Bokmål (Norway)
br=Breton
br_FR=Breton (France)
bs=Bosnian
bs_BA=Bosnian (Bosnia and Herzegowina)
byn=byn
byn_ER=byn (ER)
ca=Catalan
ca_AD=Catalan (Andorra)
ca_ES=Catalan (Spain)
ca_FR=Catalan (France)
ca_IT=Catalan (Italy (L'Alguer))
catalan=Catalan
catalan=Catalan (Spain)
crh=Crimean Tatar
crh_UA=Crimean Tatar (Ukraine)
croatian=Croatian
croatian=Croatian (Croatia)
cs=Czech
cs_CZ=Czech (Czech Republic)
csb=Kashubian
csb_PL=Kashubian (Poland)
cy=Welsh
cy_GB=Welsh (Great Britain)
czech=Czech
czech=Czech (Czech Republic)
da=Danish
da_DK=Danish (Denmark)
danish=Danish
danish=Danish (Denmark)
dansk=Danish
dansk=Danish (Denmark)
de=German
de_AT=German (Austria)
de_BE=German (Belgium)
de_CH=German (Switzerland)
de_DE=German (Germany)
de_LU=German (Luxemburg)
deutsch=German
deutsch=German (Germany)
dutch=Dutch
dutch=Dutch (Netherlands)
dz=Dzongkha
dz_BT=Dzongkha (Bhutan)
eesti=Estonian
eesti=Estonian (Estonia)
el=Greek
el_CY=Greek (Cyprus)
el_GR=Greek (Greece)
en=English
en_AG=English (Antigua and Barbuda)
en_AU=English (Australia)
en_BW=English (Botswana)
en_CA=English (Canada)
en_DK=English (Denmark)
en_GB=English (Great Britain)
en_HK=English (Hong Kong)
en_IE=English (Ireland)
en_IN=English (India)
en_NG=English (Nigeria)
en_NZ=English (New Zealand)
en_PH=English (Philippines)
en_SG=English (Singapore)
en_US=English (USA)
en_ZA=English (South Africa)
en_ZW=English (Zimbabwe)
es=Spanish
es_AR=Spanish (Argentina)
es_BO=Spanish (Bolivia)
es_CL=Spanish (Chile)
es_CO=Spanish (Colombia)
es_CR=Spanish (Costa Rica)
es_DO=Spanish (Dominican Republic)
es_EC=Spanish (Ecuador)
es_ES=Spanish (Spain)
es_GT=Spanish (Guatemala)
es_HN=Spanish (Honduras)
es_MX=Spanish (Mexico)
es_NI=Spanish (Nicaragua)
es_PA=Spanish (Panama)
es_PE=Spanish (Peru)
es_PR=Spanish (Puerto Rico)
es_PY=Spanish (Paraguay)
es_SV=Spanish (El Salvador)
es_US=Spanish (USA)
es_UY=Spanish (Uruguay)
es_VE=Spanish (Venezuela)
estonian=Estonian
estonian=Estonian (Estonia)
et=Estonian
et_EE=Estonian (Estonia)
eu=Basque
eu_ES=Basque (Spain)
fa=Persian
fa_IR=Persian (Iran)
fi=Finnish
fi_FI=Finnish (Finland)
fil=Filipino
fil_PH=Filipino (Philippines)
finnish=Finnish
finnish=Finnish (Finland)
fo=Faroese
fo_FO=Faroese (Faroe Islands)
fr=French
fr_BE=French (Belgium)
fr_CA=French (Canada)
fr_CH=French (Switzerland)
fr_FR=French (France)
fr_LU=French (Luxemburg)
french=French
french=French (France)
fur=Furlan
fur_IT=Furlan (Italy)
fy=Frisian
fy=fy
fy_DE=fy (DE)
fy_NL=Frisian (Netherlands)
ga=Irish
ga_IE=Irish (Ireland)
galego=Galician
galego=Galician (Spain)
galician=Galician
galician=Galician (Spain)
gd=Scots Gaelic
gd_GB=Scots Gaelic (Great Britain)
german=German
german=German (Germany)
gez=gez
gez_ER=gez (ER)
gez_ET=gez (ET)
gl=Galician
gl_ES=Galician (Spain)
greek=Greek
greek=Greek (Greece)
gu=Gujarati
gu_IN=Gujarati (India)
gv=Manx Gaelic
gv_GB=Manx Gaelic (Britain)
ha=Hausa
ha_NG=Hausa (Nigeria)
he=Hebrew
he_IL=Hebrew (Israel)
hebrew=Hebrew
hebrew=Hebrew (Israel)
hi=Hindi
hi_IN=Hindi (India)
hne=Chhattisgarhi
hne_IN=Chhattisgarhi (India)
hr=Croatian
hr_HR=Croatian (Croatia)
hrvatski=Croatian
hrvatski=Croatian (Croatia)
hsb=Upper Sorbian
hsb_DE=Upper Sorbian (Germany)
ht=U006Breyol
ht_HT=U006Breyol (Haiti)
hu=Hungarian
hu_HU=Hungarian (Hungary)
hungarian=Hungarian
hungarian=Hungarian (Hungary)
hy=Armenian
hy_AM=Armenian (Armenia)
icelandic=Icelandic
icelandic=Icelandic (Iceland)
id=Indonesian
id_ID=Indonesian (Indonesia)
ig=Igbo
ig_NG=Igbo (Nigeria)
ik=Inupiaq
ik_CA=Inupiaq (Canada)
is=Icelandic
is_IS=Icelandic (Iceland)
it=Italian
it_CH=Italian (Switzerland)
it_IT=Italian (Italy)
italian=Italian
italian=Italian (Italy)
iu=Inuktitut
iu_CA=Inuktitut (CA)
iw=Hebrew
iw_IL=Hebrew (Israel)
ja=Japanese
ja_JP=Japanese (Japan)
japanese=Japanese
japanese=Japanese (Japan)
ka=Georgian
ka_GE=Georgian (Georgia)
kk=Kazakh
kk_KZ=Kazakh (Kazakhstan)
kl=Greenlandic
kl_GL=Greenlandic (Greenland)
km=Khmer
km_KH=Khmer (Cambodia)
kn=Kannada
kn_IN=Kannada (India)
ko=Korean
ko_KR=Korean (Republic of Korea)
korean=Korean
korean=Korean (Republic of Korea)
ks=Kashmiri
ks_IN=Kashmiri (India)
ku=Kurdish
ku_TR=Kurdish (Turkey)
kw=Cornish
kw_GB=Cornish (Britain)
ky=Kyrgyz
ky_KG=Kyrgyz (Kyrgyzstan)
lg=Luganda
lg_UG=Luganda (Uganda)
li=li
li_BE=li (BE)
li_NL=li (NL)
lithuanian=Lithuanian
lithuanian=Lithuanian (Lithuania)
lo=Lao
lo_LA=Lao (Laos)
lt=Lithuanian
lt_LT=Lithuanian (Lithuania)
lv=Latvian
lv_LV=Latvian (Latvia)
mai=Maithili
mai_IN=Maithili (India)
mg=Malagasy
mg_MG=Malagasy (Madagascar)
mi=Maori
mi_NZ=Maori (New Zealand)
mk=Macedonian
mk_MK=Macedonian (Macedonia)
ml=Malayalam
ml_IN=Malayalam (India)
mn=Mongolian
mn_MN=Mongolian (Mongolia)
mr=Marathi
mr_IN=Marathi (India)
ms=Malay
ms_MY=Malay (Malaysia)
mt=Maltese
mt_MT=Maltese (malta)
nan=Minnan
nan_TW=Minnan (Taiwan)
nb=Norwegian, Bokmål
nb=Norwegian, Bokmål
nb_NO=Norwegian, Bokmål (Norway)
nb_NO=Norwegian, Bokmål (Norway)
nds=nds
nds_DE=nds (DE)
nds_NL=nds (NL)
ne=Nepali
ne_NP=Nepali (Nepal)
nl=Dutch
nl_AW=Dutch (Aruba)
nl_BE=Dutch (Belgium)
nl_NL=Dutch (Netherlands)
nn=Norwegian, Nynorsk
nn_NO=Norwegian, Nynorsk (Norway)
no=Norwegian, Bokmål
no_NO=Norwegian, Bokmål (Norway)
norwegian=Norwegian, Bokmål
norwegian=Norwegian, Bokmål (Norway)
nr=Southern Ndebele
nr_ZA=Southern Ndebele (South Africa)
nso=Northern Sotho
nso_ZA=Northern Sotho (South Africa)
nynorsk=Norwegian, Nynorsk
nynorsk=Norwegian, Nynorsk (Norway)
oc=Occitan
oc_FR=Occitan (France)
om=om
om_ET=om (ET)
om_KE=om (KE)
or=Oriya
or_IN=Oriya (India)
pa=Punjabi
pa=Punjabi (Shahmukhi)
pa_IN=Punjabi (India)
pa_PK=Punjabi (Shahmukhi) (Pakistan)
pap=pap
pap_AN=pap (AN)
pl=Polish
pl_PL=Polish (Poland)
polish=Polish
polish=Polish (Poland)
portuguese=Portuguese
portuguese=Portuguese (Portugal)
pt=Portuguese
pt_BR=Portuguese (Brasil)
pt_PT=Portuguese (Portugal)
ro=Romanian
ro_RO=Romanian (Romania)
romanian=Romanian
romanian=Romanian (Romania)
ru=Russian
ru_RU=Russian (Russia)
ru_UA=Russian (Ukraine)
russian=Russian
russian=Russian (Russia)
rw=Kinyarwanda
rw_RW=Kinyarwanda (Rwanda)
sa=Sanskrit
sa_IN=Sanskrit (India)
sc=Sardinian
sc_IT=Sardinian (Italy)
sd=Sindhi
sd_IN=Sindhi (India)
se=Northern Saami
se_NO=Northern Saami (Norway)
shs=Secwepemctsin
shs_CA=Secwepemctsin (Canada)
si=Sinhala
si_LK=Sinhala (Sri Lanka)
sid=sid
sid_ET=sid (ET)
sk=Slovak
sk_SK=Slovak (Slovak)
sl=Slovenian
sl_SI=Slovenian (Slovenia)
slovak=Slovak
slovak=Slovak (Slovak)
slovene=Slovenian
slovene=Slovenian (Slovenia)
slovenian=Slovenian
slovenian=Slovenian (Slovenia)
so=so
so_DJ=so (DJ)
so_ET=so (ET)
so_KE=so (KE)
so_SO=so (SO)
spanish=Spanish
spanish=Spanish (Spain)
sq=Albanian
sq_AL=Albanian (Albania)
sr=Serbian
sr_ME=Serbian (Montenegro)
sr_RS=Serbian (Serbia)
ss=Swati
ss_ZA=Swati (South Africa)
st=Sotho
st_ZA=Sotho (South Africa)
sv=Swedish
sv_FI=Swedish (Finland)
sv_SE=Swedish (Sweden)
swedish=Swedish
swedish=Swedish (Sweden)
ta=Tamil
ta_IN=Tamil (India)
te=Telugu
te_IN=Telugu (India)
tg=Tajik
tg_TJ=Tajik (Tajikistan)
th=Thai
th_TH=Thai (Thailand)
thai=Thai
thai=Thai (Thailand)
ti=ti
ti_ER=ti (ER)
ti_ET=ti (ET)
tig=tig
tig_ER=tig (ER)
title=French locale for France
title=French locale for France (French)
title=Norwegian (Bokmal) locale for Norway
title=Norwegian (Bokmal) locale for Norway (Norwegian, Bokmål)
tk=Turkmen
tk_TM=Turkmen (Turkmenistan)
tl=Tagalog
tl_PH=Tagalog (Philippines)
tn=Tswana
tn_ZA=Tswana (South Africa)
tr=Turkish
tr_CY=Turkish (Cyprus)
tr_TR=Turkish (Turkey)
ts=Tsonga
ts_ZA=Tsonga (South Africa)
tt=Tatar
tt_RU=Tatar (Russia)
tt_RU=Tatar (Tatarstan, Russian Federation)
turkish=Turkish
turkish=Turkish (Turkey)
ug=Uyghur
ug_CN=Uyghur (China)
uk=uk
uk_UA=uk (UA)
ur=Urdu
ur_PK=Urdu (Pakistan)
uz=Uzbek
uz_UZ=Uzbek (Uzbekistan)
ve=Venda
ve_ZA=Venda (South Africa)
vi=Vietnamese
vi_VN=Vietnamese (Vietnam)
wa=Walloon
wa_BE=Walloon (Belgium)
wo=Wolof
wo_SN=Wolof (Senegal)
xh=Xhosa
xh_ZA=Xhosa (South Africa)
yi=Yiddish
yi_US=Yiddish (USA)
yo=Yoruba
yo_NG=Yoruba (Nigeria)
zh=Chinese
zh_CN=Chinese (P.R. of China)
zh_HK=Chinese (Hong Kong)
zh_SG=Chinese (Singapore)
zh_TW=Chinese (Taiwan)
zu=Zulu
zu_ZA=Zulu (South Africa)

Translating basics

In language files, the keyword is on the left of an equal sign, being the constant value that is always the same, and the translated string is on the right of the equal sign, and will appear exactly as show in the game (including case, with a few exceptions where proper sentence case will automatically be done). For example:

keyword=Translated string!

In this above example, the keyword is "keyword", and in game, you'd just see "Translated string!". A keyword might be "PlayNow", which is the keyword for the button in the custom game and scenario menus which lets you begin the game. In english, the translated string is "Play now!", so in the language file, this looks like:

PlayNow=Play now!

Comments can be inserted into language files by starting the line with a semicolon (;). Each new line of the file is a new translation string, blank and comment lines ignored.

Techtree language file

The techtree language file contains just a few basic things, the resources, faction names, attack types, and armor types. The key words for all of these are exactly as they appear in the XMLs and folders, so if you have a gold resource (which means you should have a folder and corresponding XML named "gold" in the resource's folder), that would be the keyword.

For example, Magitech's language file would have to translate the name of the tech faction, which would look like this in the english language file:

tech=Tech

Faction language file

Factions are where more versatility comes in. Unit names, upgrade names, command names, tooltips, and level names would all appear in this file. Unit names, upgrade names, and level names would all be taken as they appear in the XML, so if you have a unit name "swordman", then that would be a keyword in the language string. Tooltips, however, are added in slightly differently.

Tooltips

If adding a tooltip directly to a command, it can be added to any command, be it attack, produce, etc. This is done by giving the name tag a tip attribute. For example, the below is an attack command with a tooltip added:

<command>
  <type value="attack" />
  <name value="attack" tip="my_attack_tooltip" />
  <image path="images/attack.bmp" />
  <unit-requirements />
  <upgrade-requirements />
  <move-skill value="move_skill" />
  <attack-skill value="attack_skill" />
</command>

Thus, "my_attack_tooltip" is now the keyword for the tooltip of this command. In the language file, we can reference that keyword and give it some proper text, eg:

 my_attack_tooltip=The unit will attack a foe with frenzy fury.

For build commands which give multiple building choices, you can specify different tooltips for each building by giving the building tags a tooltip, such as in the example below:

<command>
  <type value="build" />
  <name value="build" />
  <image path="images/build.bmp" />
  <unit-requirements />
  <upgrade-requirements />
  <move-skill value="move_skill" />
  <build-skill value="build_skill" />
  <buildings>
    <building name="building1" tip="building1_tip" />
    <building name="building2" tips="building2_tip" />
  </buildings>
  <start-sound enabled="true"></start-sound>
  <built-sound enabled="true"></built-sound>
</command>

For the two click system for buildings, you can also specify a subheader, which will be the header at the top of the tooltip, by default the command name, but the "%s" value will be replaced with the building's name, so you could, for example, use a subheader of "Build %s" so that the tooltip header for building1 would say "Build Building1", not just "Build". This is done as seen below:

<command>
  <type value="build" />
  <name value="build" />
  <image path="images/build.bmp" />
  <unit-requirements />
  <upgrade-requirements />
  <move-skill value="move_skill" />
  <build-skill value="build_skill" />
  <buildings>
    <building name="building1" tip="building1_tip" sub-header="build_subheader" />
    <building name="building2" tips="building2_tip" sub-header="build_subheader" />
  </buildings>
  <start-sound enabled="true"></start-sound>
  <built-sound enabled="true"></built-sound>
</command>

And the language file would get:

build_subheader=Build %s

See also