I18N.pl

From The DarkMod Wiki
Revision as of 11:30, 27 November 2011 by Tels (talk | contribs) (update)
Jump to navigationJump to search

Introduction

The script fm_translate.pl separates the main FM data from all the texts and other assets that need to be changed in order for translation.

Requirements

Usage

On a console (a "DOS Window" under Windows):

perl fm_translate.pl --english fms/outpost/outpost.pk4 --french fms/avant_poste.pk4

The output packages will be created under output, as:

output/outpost.pk4
output/outpost_i18n.pk4

The FM dictionaries

Once the script is finished, it will replace as much hard-coded strings like "Silver Key" with string temlates like "#str_20000" and place these in a FM-specific dictionary. These dictionaries are put into a sep. PK4 file under the directory strings/fm/.

See here for examples and how to translate these files.

Bugs

Currently GUI files are not parsed, and thus their strings not entered into the FM dictionary. Mainly this means you need to manually edit guis/maps/FMNAME.gui and replace things like:

text   "Mission Loading"

with

text   "#str_02236"       // Mission Loading

If there are other texts in it, like "Loading finished", and these cannot be found in strings/all.lang in the TDM core, then you need to use numbers above 20000 (best use 20100 and above) and then also add the strings into the strings/fm/english.lang etc. file.

Also note that the main PK4 file should always contain a copy of the strings/fm/english.lang file, so that people who do not have the _l10n.pk4 file can still play the FM.

See also