I18N - Translating Fan Missions: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Tels (talk | contribs)
rename i18n.pk4 to l10n.pk4
Tels (talk | contribs)
m typo
Line 13: Line 13:
These dictionaries live in the directory '''strings/fm/''' and must follow a specific format, explained below. The name for such a dictionary is always '''LANGUAGE.lang''', f.i. "english.lang".
These dictionaries live in the directory '''strings/fm/''' and must follow a specific format, explained below. The name for such a dictionary is always '''LANGUAGE.lang''', f.i. "english.lang".


The string IDs for FMs are 20000 .. 89999, using these ensures that they do not conflict with strings from the TDM core. Note that if you have a string that matches one of the other core strings (like "Silver Key", "#str_10000"), then you should use just the core string ID. This saves the translators to translate the string again.
The string IDs for FMs are 20000 89999, using these ensures that they do not conflict with strings from the TDM core. Note that if you have a string that matches one of the other core strings (like "Silver Key", "#str_10000"), then you should use just the core string ID. This saves the translators to translate the string again.


You '''MUST''' also separate them from the rest of your FM into their own package called "YOURFM_l10n.pk4" where YOURFM is the name of your original PK4 file. This ensures that TDM can install/update the I18N package properly.
You '''MUST''' also separate them from the rest of your FM into their own package called "YOURFM_l10n.pk4" where YOURFM is the name of your original PK4 file. This ensures that TDM can install/update the I18N package properly.

Revision as of 06:32, 28 November 2011

Introduction

Important: Use I18N.pl to prepare an FM before you attempt to translate it!

darkmod.txt

In addition, if you translate strings in darkmod.txt, DO NOT translate the field names like Author:, Required TDM Version: etc. These must stay in English, or TDM will not be able to interpret them. Only translate the text that comes after them! If you use I18N.pl, this will be automatically done for you, you should not edit darkmod.txt in this case!

If you want to add your name to the credits, include it in a README.txt file inside YOURFM_l10n.pk4 file.

FM Specific Dictionaries

These dictionaries live in the directory strings/fm/ and must follow a specific format, explained below. The name for such a dictionary is always LANGUAGE.lang, f.i. "english.lang".

The string IDs for FMs are 20000 … 89999, using these ensures that they do not conflict with strings from the TDM core. Note that if you have a string that matches one of the other core strings (like "Silver Key", "#str_10000"), then you should use just the core string ID. This saves the translators to translate the string again.

You MUST also separate them from the rest of your FM into their own package called "YOURFM_l10n.pk4" where YOURFM is the name of your original PK4 file. This ensures that TDM can install/update the I18N package properly.

Let's see how this looks for the FM named Outpost, which provides two translations (English and French):

 outpost.pk4:

  xdata/outpost.xd
  maps/outpost.map
  maps/outpost.cm
  maps/outpost.proc
  maps/outpost.script
  maps/outpost.aas32

 outpost_l10n.pk4:

  strings/fm/english.lang
  strings/fm/french.lang
  README.txt                      // f.i. with credits for translators

Note that all files names should be in lowercase, otherwise there can be problems under Linux.

Example dictionary, note the entire content is wrapped in "{ }"

// String table english (iso-8859-1) for: The Outpost

// This file was generated automatically on 2011-08-20 13:56 UTC by i18n.pl v0.02
{
  "#str_20000"  "The Outpost"
  "#str_20001"  "Break into a builder outpost to retrieve a gold ingot."
  "#str_20002"  "Gold Ingot"
  "#str_20003"  "Leave the outpost after your main objectives are done and get back to the front gates."
  "#str_20004"  "You won't find bags full of money in a builder outpost, but take away any valuables you can get hold of. Find valuables worth at least 600."
  "#str_20005"  "You won't find bags full of money in a builder outpost, but take away any valuables you can get hold of. Find valuables worth at least 700."
  "#str_20006"  "No knock outs too."
  "#str_20007"  "Killing is not your style. No corpses tonight."
  "#str_20008"  "You won't find bags full of money in a builder outpost, but take away any valuables you can get hold of. Find valuables worth at least 800."
  "#str_20009"  "The massive gold ingot should be worth a fair amount of money. Find out where the ingot is kept and change its ownership."
}

This setup makes it easier to translate the FM, because an translator needs only to copy english.lang to german.lang, change the strings, repackage the outpost_l10n.pk4 file, and it works!


See Also

Translation resources

Overview of translations

Translation discussions