Translations (OpenXcom)

From UFOpaedia
Jump to: navigation, search

Like the original, OpenXcom supports translation of all ingame strings. However, the format has been changed to make it easier to edit, maintain and add support for Unicode. Currently the easiest way to translate is to use the GetLocalization online tool.

Guidelines

  • Preserve the original structure: Don't change text inside {} tags and keep any spaces, uppercases, etc. that the original string has, unless you have a good reason not to.
  • Be consistent: Don't make the text look schizophrenic, stick to one style throughout. If a word has multiple translations, choose one and stick with it. If working with multiple translators, be sure to work this out before-hand.
  • Don't use automatic translations: We're not robots. Only use them to assist you. I recommend Linguee since it uses real translations.
  • Review your work: Again, we're not robots and make mistakes every now and then. Don't forget to use a spellchecker.
  • Pay attention to length: while most of the interface is fairly roomy (eg. Ufopaedia screens), some elements just can't fit a lot of words into a tight 320x200 screen (eg. columned lists). Remember you can test your translation ingame by downloading the file to your Language folder.

Pluralization

Some strings have different forms depending on the associated number {N}, for example "1 day" and "2 days". Different languages have different pluralization rules, you can ignore the cases that don't apply to your language as they won't be used by the game.

Graphics

Sadly a translator's job isn't just replacing strings. Sometimes you also need to have a little bit of artistry. The game uses bitmap fonts to display text, so if your language has new characters that it doesn't support, you'll have to add them in yourself. The font files are PNG images in the Language folder, which are referenced by a Font.dat text file which contains all the characters in the fonts (in UTF-8). To add a character you just put it at the end of the chars: in Font.dat and then draw them into the font files (both lowercase and uppercase).

Testing

To test your translations in-game you just need to put them in the Data\Language folder. You can get the latest translations from GetLocalization here, they are updated hourly. If you need to check how much room you have for a string, you can enable debugUi in your options.cfg to see the text boxes in-game.

Format

Language files are stored in YAML format (UTF-8). Here's a typical language file:

en-US:
  STR_AVENGER_UFOPEDIA: "TRANSPORTER AND COMBAT SPACECRAFT.  THE ULTIMATE REPLICATION OF ALIEN TECHNOLOGY."
  STR_INTERCEPTOR_UFOPEDIA: "COMBAT AIRCRAFT WITH DUAL PULSE DETONATION ENGINES AND SPECIALLY SHIELDED ELECTRONIC SYSTEMS.  THE BEST AVAILABLE EARTH BASED TECHNOLOGY."
  STR_LIGHTNING_UFOPEDIA: "TRANSPORTER AND COMBAT CRAFT.  A CRUDE BUT EFFECTIVE REPLICATION OF ALIEN PROPULSION SYSTEMS."
  STR_SKYRANGER_UFOPEDIA: "TROOP TRANSPORTER.  THE FASTEST OF ITS KIND, WITH VERTICAL TAKE OFF AND LANDING (V.T.O.L.) CAPABILITY."
  STR_FIRESTORM_UFOPEDIA: "COMBAT CRAFT.  THIS ONE-MAN FIGHTER REPLICATES THE CLASSIC ALIEN FLYING SAUCER DESIGN, WITH CENTRAL PROPULSION UNIT."
  ...

The first line contains the IETF language tag (same as the filename). The rest of the text are just key-string pairs, separated by linebreaks. Language files are placed in the Data\Language folder and have the .yml extension.

External Links