From ZDoom Wiki
Jump to navigation Jump to search

The LANGUAGE lump allows modders to define placeholder keywords and their string translation in several languages. As of GZDoom 4.0.0, there are two varieties of LANGUAGE lump: A .csv spreadsheet exported from Google Docs containing strings for multiple languages, or the old-style plaintext format, which typically holds only one language at a time with multiple LANGUAGE lumps present. 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.

This wiki page primarily concerns the old-style format, which modders are still encouraged to use. For more information on the official translation spreadsheet, see internationalization.

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
  • el: 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
  • ru: 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.

Additional functionality

Strings defined in this lump supports some of Print's escape sequences, such as color (\c) and new line (\n).

Strings can also be split into multiple lines. In order for the strings to be split up in game, the new line escape character must be used. Otherwise, they will simply be merged together as one.

	"This string is split into\n" // NO COMMAS AFTER THE DOUBLE QUOTATIONS.
	"multiple lines by the\n"
	"new line escape character.\n"; // Strings are all terminated with a semicolon.

	"This string, on the other hand "
	"is NOT split up because the "
	"new line escape characters "
	"are not used. ";

A string can also be defined to point to another LANGUAGE string label (not necessarily within the same lump). This can be useful to avoid duplication:

MY_STRING_1 = "String 1 or 2";
MY_STRING_2 = "$$MY_STRING_1"; // MY_STRING_2 will also resolve to "String 1 or 2"

You can define a string only for a specific game by prefixing it with $ifgame(gamename), where 'gamename' can be any of 'doom', 'heretic', 'hexen', 'strife' or 'chex':

GAME_STRING = "This will be the text for any game";
$ifgame(heretic) GAME_STRING = "This will be the text for heretic";


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");


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 ZScript

ZScript strings will not automatically resolve to the desired definition in LANGUAGE. However, getting the string is simple. This example gets the defined QUITMSG string. If the string isn't found, it will simply return $QUITMSG.

e.g.:String quitmessage = Stringtable.Localize("$QUITMSG");


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

Compare with map MYMAP "My map".


Strings defined in LANGUAGE can be retrieved for the hint text of a secret entry by prefixing its keyword with the $ sign.



// 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.";

/* 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.";

/* 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