OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Format of the language files.

Language files are formatted as YAML (.yml) containing UTF-8 (no BOM) text.

The first line in a language file is the language's identifier. The rest of the file are key-value pairs. The key of each pair contains the ID string (dictionary key), and the value contains the localized text for the given key in quotes.

The localized text may contain the following special markers:

{0, 1, 2, ... } These markers will be replaced by programmer-supplied values before the message is displayed.
{ALT} The rest of the text will be in an alternate color. Using this again will switch back to the primary color.
{NEWLINE} It will be replaced with a line break in the game.
{SMALLLINE} The rest of the text will be in a small font.

There is an additional marker sequence, that should only appear in texts that depend on a number. This marker {N} will be replaced by the actual number used. The keys for texts that depend on numbers also have special suffixes, that depend on the language. For all languages, a suffix of _zero is tried if the number is zero, before trying the actual key according to the language rules. The rest of the suffixes depend on the language, as described here.

So, you would write (for English):

STR_ENEMIES:
  zero:  "There are no enemies left."
  one:   "There is a single enemy left."
  other: "There are {N} enemies left."