LANGUAGE

From ZDoom Wiki
Jump to: navigation, search

LANGUAGE allows to define placeholder keywords and their string translation in several languages. LANGUAGE lumps, like all other text lumps, are cumulative and allow both types of C-style comments.

A LANGUAGE lump is a series of sections containing associations between a keyword (usually in ALLCAPS) and a string (between quote marks), ended with a semicolon. A section begins by a header containing the appropriate language codes between square brackets (several language codes can be contained in the same header) and continues until the next section header is encountered.

ZDoom.pk3 provides full support for US English (language.enu) and partial support for French (language.fr), Italian (language.ita), and (New from 2.7.1) Brazilian Portuguese (language.ptb).

Language codes

To know which language code to use, ZDoom looks in the Windows registry (if available). As a result, the language codes used are the same as in Windows.

  • default: The fallback used if no translation in the user's language is available, or if the user's language is unknown. If the default isn't available either, the keyword will be displayed directly.
  • csy: Czech
  • dan: Danish
  • de: German (all variants)
  • dea: Austrian German
  • des: Swiss German
  • deu: Germany German
  • ell: Greek
  • en: English (all variants)
  • ena: Australian English
  • enc: Canadian English
  • eng: British English
  • eni: Irish English
  • enu: US English
  • enz: New Zealand English
  • esm: Mexican Spanish
  • esn: Modern Spanish
  • esp: Castilian Spanish
  • eti: Estonian
  • fin: Finnish
  • fr: French (all variants)
  • fra: France French
  • frb: Belgian French
  • frc: Canadian French
  • frs: Swiss French
  • hun: Hungarian
  • isl: Icelandic
  • ita: Italian
  • its: Swiss Italian
  • nlb: Belgian Dutch
  • nld: Dutch
  • non: Norwegian (Nynorsk)
  • nor: Norwegian (Bokmal)
  • plk: Polish
  • ptb: Brazilian Portuguese
  • ptg: Portuguese
  • rus: Russian
  • sky: Slovak
  • sv: Swedish
  • trk: Turkish

Keep in mind that for some of these languages, providing new fonts may be required as the default fonts in Doom, Heretic, Hexen and Strife do not cover accented characters or non-Latin characters.

In ACS

Strings defined in LANGUAGE can be retrieved in ACS in functions that use string such as Print and HudMessage. With the letter 'l' specifier you can retrieve strings defined in LANGUAGE.

e.g.: Print(l:"ALARMWARN");

In DECORATE

Strings defined in LANGUAGE can be retrieved in DECORATE by prefixing their keyword with the $ sign and putting it between quote marks. If ZDoom doesn't find any string for this keyword in the user's language's section, it will look for a match in the default section. If there is no match there either, the keyword will be displayed directly.

e.g.: Obituary "$OB_MYMONSTER"

In MAPINFO

Strings defined in LANGUAGE can be retrieved in two different ways in MAPINFO. A name value without space and prefixed with a $ sign will be interpreted as a keyword. Alternatively, the lookup value can be used to directly indicate a keyword. If lookup is used, then the keyword should not be within quotes.

e.g.:map MYMAP lookup HUSTR_MYMAP
map MYMAP name "$HUSTR_MYMAP"

Compare with map MYMAP "My map".

Example

// This is an example LANGUAGE LUMP

[enu default] 
/* This section is both for American English (enu -> en US) and the default language
   (used if there are no available translations for the user's own language).        */

S_SUPERWEAPON = "Picked up the ultimate superweapon!";
NEEDMAUVEKEYD = "You need a mauve key to open this door.";
NEEDMAUVEKEYO = "You need a mauve key to activate this object.";

[fr]
/* And now a French translation for the above lines */

S_SUPERWEAPON = "La super-arme ultime !";
NEEDMAUVEKEYD = "Il vous faut la clef mauve pour ouvrir cette porte.";
NEEDMAUVEKEYO = "Il vous faut la clef mauve pour actionner cet objet.";

[de]
/* In German, too */
S_SUPERWEAPON = "Die maximale Überwaffe !";
// Oh no, what about the mauve key messages? They don't have a translation!
// Then they'll just use the English versions above since they're also defined as being the default.


See also