Difference between revisions of "Translations (OpenXcom)"

From UFOpaedia
Jump to navigation Jump to search
 
(35 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Like [[GeoScape String Files|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.
+
Like [[GeoScape String Files|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 [https://www.transifex.com/projects/p/openxcom/ Transifex web site].
 +
 
 +
== 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. Transifex has handy [https://www.transifex.com/projects/p/openxcom/glossary/l/en_US/ Glossary tool] for that. During translation you will receive highlights for known words.
 +
* Don't use automatic translations: We're not robots. Only use them to assist you. I recommend [http://www.linguee.com/ 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.
 +
 
 +
== 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. These fonts are limited with Latin extended, Greek, and Cyrillic alphabets. If your language has new characters that it doesn't support, you'll have to add [[font collection (OpenXcom)|them in yourself]] and create it as [[mods (OpenXcom)|mod]].
 +
 
 +
== Testing ==
 +
 
 +
To test your translations in-game you just need to put the ''for_use_openxcom_x-com-1_(countryCode).yml'' file in the ''common\Language\'' folder and the ''for_use_openxcom_x-com-1_(CountryCode).yml'' file in the ''\standard\xcom1\Language'' folder. If you have translations for xcom2 you can put the equivalent file in the ''\standard\xcom2\Language'' folder.
 +
You can get the latest translations directly from Transifex by clicking the resource name. They are also available in the Git builds. 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 ==
 
== Format ==
  
Language files are stored in plain-text UTF-8 (no BOM) format with Linux linebreaks. If you don't know what this is, get a text editor that does (I recommend [http://notepad-plus-plus.org/ Notepad++] for Windows users). Here's a typical language file:
+
Language files are stored in YAML format (UTF-8). Here's a typical language file:
  
 
<pre>
 
<pre>
ENGLISH (US)
+
en-US:
STR_AVENGER_UFOPEDIA
+
  STR_AVENGER_UFOPEDIA: "TRANSPORTER AND COMBAT SPACECRAFT.  THE ULTIMATE REPLICATION OF ALIEN TECHNOLOGY."
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_INTERCEPTOR_UFOPEDIA
+
  STR_LIGHTNING_UFOPEDIA: "TRANSPORTER AND COMBAT CRAFT.  A CRUDE BUT EFFECTIVE REPLICATION OF ALIEN PROPULSION SYSTEMS."
COMBAT AIRCRAFT WITH DUAL PULSE DETONATION ENGINES AND SPECIALLY SHIELDED ELECTRONIC SYSTEMS.  THE BEST AVAILABLE EARTH BASED TECHNOLOGY.
+
  STR_SKYRANGER_UFOPEDIA: "TROOP TRANSPORTER.  THE FASTEST OF ITS KIND, WITH VERTICAL TAKE OFF AND LANDING (V.T.O.L.) CAPABILITY."
STR_LIGHTNING_UFOPEDIA
+
  STR_FIRESTORM_UFOPEDIA: "COMBAT CRAFT.  THIS ONE-MAN FIGHTER REPLICATES THE CLASSIC ALIEN FLYING SAUCER DESIGN, WITH CENTRAL PROPULSION UNIT."
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.
 
...
 
 
</pre>
 
</pre>
  
The first line contains the language name ''in its native language'' as displayed in the Language window. 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 .lng extension.
+
The first line contains the [http://www.i18nguy.com/unicode/language-identifiers.html 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.
 +
 
 +
==Special cases==
 +
=== 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 (See [http://cldr.unicode.org/index/cldr-spec/plural-rules Unicode Language Plural Rules] for the reference), you can ignore the cases that don't apply to your language as they won't be used by the game. Otherwise you should provide all plural forms needed for your language.
 +
 
 +
For example, if you are translating OpenXcom to Czech, en-US.yml for English have these lines:
  
To make your own translation, just copy an existing language file and edit the strings with your favorite text editor. '''Do not edit the keys or any text between {}'''.
+
<code>
 +
  STR_DAY:
 +
    one: "{N} day"
 +
    other: "{N} days"
 +
</code>
 +
 
 +
As we can see, English has only 2 plural forms, ''one'' and ''other''. But Czech has 3 plural forms: ''one'' ("1 den"), ''few'' ("2 dny") and ''other'' ("5 dní"). Therefore, the cz.yml file should look like this:
 +
 
 +
<code>
 +
  STR_DAY:
 +
    one: "{N} den"
 +
    few: "{N} dny"
 +
    other: "{N} dní"
 +
</code>
 +
 
 +
The OpenXcom engine will choose the correct plural form, based on the digit (''{N}'').
 +
 
 +
=== Gender-specific messages ===
 +
Again, some languages have messages, that differ for male or female character. For example, in Russian we have two variants of "''<Soldier name> has Panicked''": "''<Soldier name> запаниковал''" (for male character) and "''<Soldier name> запаниковала''" (for female character). For this case we have two strings with _MALE and _FEMALE suffixes:
 +
 
 +
<code>
 +
  STR_HAS_PANICKED_MALE: "{0}{NEWLINE}запаниковал"
 +
  STR_HAS_PANICKED_FEMALE: "{0}{NEWLINE}запаниковала"
 +
</code>
 +
 
 +
If your language doesn't have such features, just provide for both strings same translation. Otherwise, fill male and female messages accordingly their suffixes.
  
== Guidelines ==
 
* Don't add linebreaks: The game automatically word-wraps text, and any explicit linebreaks are marked with {NEWLINE} and {SMALLLINE}.
 
* Preserve the original structure: Keep any spaces, uppercases, etc that the original string has, don't go trimming and cleaning up for no good reason.
 
* 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 an automatic translator: We're not robots.
 
* 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 anytime.
 
  
== Current Translations ==
+
== External Links ==
  
{| class="wikitable"
+
* [http://openxcom.org/forum/index.php/board,6.0.html Translations forum]
|-
 
! Name
 
! Status
 
! Translators
 
|-
 
| [http://openxcom.org/forum/index.php/topic,153.0.html Czech]
 
| Complete
 
| Roman Janik, Mortal
 
|-
 
| [http://openxcom.org/forum/index.php/topic,158.0.html Danish]
 
| WIP
 
| bramcor
 
|-
 
| [http://openxcom.org/forum/index.php/topic,274.0.html Dutch]
 
| WIP
 
| Daiky
 
|-
 
| English (UK)
 
| Ripped
 
| Microprose
 
|-
 
| English (US)
 
| Ripped
 
| Microprose
 
|-
 
| French
 
| Ripped
 
| Microprose
 
|-
 
| German
 
| Ripped
 
| Microprose
 
|-
 
| Italian
 
| Ripped
 
| Microprose
 
|-
 
| [http://openxcom.org/forum/index.php/topic,199.0.html Japanese]
 
| WIP
 
| hsbckb
 
|-
 
| [http://openxcom.org/forum/index.php/topic,159.0.html Polish]
 
| Complete
 
| Kloqus
 
|-
 
| [http://openxcom.org/forum/index.php/topic,163.0.html Portuguese (PT)]
 
| WIP
 
| SupSuper
 
|-
 
| [http://openxcom.org/forum/index.php/topic,157.0.html Romanian]
 
| WIP
 
| cort
 
|-
 
| [http://openxcom.org/forum/index.php/topic,161.0.html Russian]
 
| Complete
 
| Alexander Pikunov, Sergei Obryaschikov, Wasteland Ghost, Ghoul, winterheart
 
|-
 
| [http://openxcom.org/forum/index.php/topic,155.0.html Traditional Chinese]
 
| WIP
 
| hsbckb
 
|-
 
| [http://openxcom.org/forum/index.php/topic,154.0.html Ukrainian]
 
| WIP
 
| marabus
 
|}
 
  
 
[[Category:OpenXcom]]
 
[[Category:OpenXcom]]

Latest revision as of 18:58, 29 August 2021

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 Transifex web site.

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. Transifex has handy Glossary tool for that. During translation you will receive highlights for known words.
  • 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.

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. These fonts are limited with Latin extended, Greek, and Cyrillic alphabets. If your language has new characters that it doesn't support, you'll have to add them in yourself and create it as mod.

Testing

To test your translations in-game you just need to put the for_use_openxcom_x-com-1_(countryCode).yml file in the common\Language\ folder and the for_use_openxcom_x-com-1_(CountryCode).yml file in the \standard\xcom1\Language folder. If you have translations for xcom2 you can put the equivalent file in the \standard\xcom2\Language folder. You can get the latest translations directly from Transifex by clicking the resource name. They are also available in the Git builds. 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.

Special cases

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 (See Unicode Language Plural Rules for the reference), you can ignore the cases that don't apply to your language as they won't be used by the game. Otherwise you should provide all plural forms needed for your language.

For example, if you are translating OpenXcom to Czech, en-US.yml for English have these lines:

 STR_DAY:
   one: "{N} day"
   other: "{N} days"

As we can see, English has only 2 plural forms, one and other. But Czech has 3 plural forms: one ("1 den"), few ("2 dny") and other ("5 dní"). Therefore, the cz.yml file should look like this:

 STR_DAY:
   one: "{N} den"
   few: "{N} dny"
   other: "{N} dní"

The OpenXcom engine will choose the correct plural form, based on the digit ({N}).

Gender-specific messages

Again, some languages have messages, that differ for male or female character. For example, in Russian we have two variants of "<Soldier name> has Panicked": "<Soldier name> запаниковал" (for male character) and "<Soldier name> запаниковала" (for female character). For this case we have two strings with _MALE and _FEMALE suffixes:

 STR_HAS_PANICKED_MALE: "{0}{NEWLINE}запаниковал"
 STR_HAS_PANICKED_FEMALE: "{0}{NEWLINE}запаниковала"

If your language doesn't have such features, just provide for both strings same translation. Otherwise, fill male and female messages accordingly their suffixes.


External Links