Internationalisation
Crimson Fields supports localisation (currently latin scripts only). This document describes the steps to make the game speak your language.
Known Problems
The font distributed with Crimson Fields lacks a number of glyphs which may be required for proper display of your language. If some characters are not displayed (correctly) this is most probably the cause. A temporary solution is to locally replace the Bepa-Roman.ttf file with a more complete TTF font file.
New Translations
Adding support for an additional language to Crimson Fields is a matter of three separate, but similar steps:
Translation of the in-game messages
The best way to do this is to copy the file locale/en.tmpl (or a template of another language that you want to use as the base of your work; the English version is authoritative, though) to locale/<yourLocaleCode>.tmpl and then translate all messages contained in this file.The underscore is used to define the keyboard equivalents to buttons etc. This mechanism currently only works with standard 7-bit ASCII characters. Also make sure that you don't use the same shortcut for two or more widgets which can appear in the same dialog.
When the translation is complete call
tools/mklocale -l <yourTemplate> <locale>
to transform the template into a language data file <locale> and copy this file to the Crimson Fields data directory as locale/<yourLocaleCode>.dat. Upon launching the game, your language should now be available. Having a translation for the in-game messages is prerequisite to the following steps.
Translation of unit names
(up to and including version 0.4.5):
This currently has to be done in the sources (tools/default_units.c). Copy one of the existing names sections at the end of the file and modify it. To check the results, run make in the tools directory and then copy the file default.units into the Crimson Fields data directory.(versions 0.4.6 and later, including current CVS):
Unit stats are defined in the file tools/default.usrc. Each unit has one or more lines of the formname(en) = Infantry
To add another translation, simply add a new line for your language. After adding e.g. German the above example would read
name(en) = Infantry name(de) = Infanterie
To check the result after you have finished your modifications, run make in the tools directory and copy the file default.units into the Crimson Fields data directory.
Translations of missions
Each mission (levels/*.src) contains one or more messages sections ("[messages(<localeCode>)]"). Copy one of these sections (again, English should be considered authoritative) and translate the messages. After that, run the file through cfed again (usuallytools/cfed levels/<mission>.src --tiles tools/default.tiles \ --units tools/default.units
) and copy the resulting file into the Crimson Fields maps directory.
All messages must be encoded in UTF-8 format! If translations for unit names or a mission do not exist in the selected game language, the english version will be used.