diff --git a/README.i18n.md b/README.i18n.md new file mode 100644 index 00000000..61b4bdec --- /dev/null +++ b/README.i18n.md @@ -0,0 +1,110 @@ +# Colobot data translation + +The translation of Colobot level titles, level hierarchy and help files +is managed through [gettext](https://www.gnu.org/software/gettext/). + +## Level scene description files + +Level scene description files have english headers that are used in the +Colobot interface to describe the levels. Level scene description files +are levels/$level/scene.txt and translations are handled in the +level-specific po/ directory: levels/$levels/po/. The .pot file is the +source translation file, the *.po files are the translations. + +## Help files + +Helpfiles are divided in two categories: +* Generic helpfiles, about the game, the objects, the syntax, etc. These + are stored in help/ , in four sub-categories: generic, bots, object + and bots. +* Level-specific helpfiles, about the level, instructions, example + programs, etc. These are stored in levels/$level/help/. + +Helpfiles have their source in english, always stored in the E/ +subdirectory. To ensure retro-compatibility, existing translations have +not been integrated in the gettext-based translation mechanisms and are +stored in their respective one-character directories. New translations +snd updates to existing ones should really use the gettext-based +translation. + +## Colobot syntax + +Colobot parses a specific syntax to enable some formatting in the game +interface. + +To ease translation, this syntax is transformed into a pseudo-HTML +syntax in the gettext files. + +Here is the table of transformations and their meanings: + +
Transformed label | +Colobot native label | +Description | +
<button $buttonID/> | +\button $buttonID; | +Indicates a UI button. $buttonID is a number | +
<key $keyCode/> | +\key $keyCode; | +Indicates a keyboard key. $keyCode is a code, such as action | +
<format $formatID>Formatted text</format> | +\$formatID;Formatted text\norm; | +Changes text formatting in the marker. $formatID can be const, type, token or key. | +
<$formatID/> | +\$formatID; | +Toggle text formatting. $formatID can be const, type, token, key or norm. | +
<a $link>Link text</a> | +\l;Link text\u $link; | +Direct hyper-link. $link can be direct or in a category (such as cbot\abstime) | +
<a $linkcat|$link>Link text</a> | +\l;Link text\u $linkcat\$link; | +In-category hyper-link, linkcat can only be cbot, bots or object. | +
<code>CBot code</code> | +\c;CBot code\n; | +Code formatting | +
<s/> | +\s; | +Typewriter line indicator (usually verbatim code) | +
<t/> | +\t; | +Title line indicator | +
<b/> | +\b; | +Subtitle line indicator | +
<c/> | +\c; | +Typewriter formatting toggle | +
<n/> | +\n; | +Normal formatting toggle | +