Translations
Search:
print pdf

HaCKeD Nofearx38

Translations


X-Force supports multi-language texts in many areas. The developer team provides german and english translations. Other translations can be done by anyone based on those languages. An overview of the available languages and the status of their translations can be found at translation site. There you can download the current language packages.

The following areas can be translated:
  • The user-interface of X-Force
  • The tips and tricks when starting X-Force
  • The gamesets
  • The gameset-editor (with the exception of object feature)
  • The online-updater (config.exe)

We'll try to make the remaining other areas avaible for translations as soon as possible.

The following text describes how to start with a new translations and lists the translations already done.

General


With exception of the gamesets the translation is made by separate language files, which are stored in a special directory (see directory structure).

The translations of gamesets are saved inside the gameset and it depends on the gameset developer which languages are avaible for the specific gameset. Several import and export functions help the gameset developer with adding new languages into the gameset (see translating of the gamesets).

Translating of language files


Directory structure

Under the X-Force main directory there is the directory language for the language files. This is divided into several sub-directories:

language
- edit
- config
- tips

  • directly in the language directory are the language files for X-Force game program itself
  • unter edit are the files for the gameset editor
  • unter config are the files for the online-updater (config.exe)
  • unter tips are the files for the tipps and tricks.

Changing the language files

All entries in the languages files have the following structure: Constant=Text

constant= must not be changed/translated, 'cause only by that constant name the program can identify and assign a text. A text can't be longer than one line, but you can mark a line upheaval with \n in a text.

For an optimal performance when the texts are loading, their order should not be changed. Any constant should be listed once in the files and never be deleted.

To make the work for the translators easier any changes done by the programming team are marked in the language files like this:

constant=(new) New text (old) old text

The program itself will only display the translation listed behind (new). The tags (new), (old) and anything beyond (old) will not be displayed.
If there is no tag (old) then the constant did not have a previous translation but is a new one. If there is such a tag the constant did exist in the previous version of the language file, but the use of that constant was changed. In all cases the text after the (new) describes the intended meaning and needs to be checked and corrected. After this there should only be the new translated text in the line. The tag (new) and everything beginning with (old) can be deleted - it was only for documentation.

(new) is the signal that a translation is missing. If you only want to complete the missing translations, you only have to search for (new) in the language file with a texteditor und you can translate the texts.

Contact with format-string constants

In a lot of texts are variable parts entered by the program. They can be identified by a % followed by one of a few format-discriptions:

  • %s - A variable text (string) is entered here
  • %d - A decimal number (without internal decimal places) is entered here
  • %.xn - x is a number. A floating-point number with x internal decimal places is entered here

The number and the types of the format-codes must not be changed in a text. Doing so would cause errors and defects as soon as that line is used in the game. If the original text has two text variables (%s), they have to be in the new text as well. The type of variable must also remain the same.

If the grammar or the spelling changed the order in the text, you have to mention the original position of the variable by placing x: (x is the old position, begins by 0) after the %:

Example:

original german text: Von %s hast du noch %.0n im Lager.

english text with displaced format strings: You have %.0n of %s in your storage room.

This would cause a problem, because the first variable has to be a text, but with %.0n is a number marked. Cause of that, you have to enter the position feature:

english text with corrected format strings: You have %1:.0n of %0:s in your storage room.

The program knows now that =[%.0n=] is the second of the original variables and %s is the first one and can assign the correct names and numbers. The positioning begins by 0: the first variable of the original text has the index 0, the second has the index 1 and so on.

To show a percent mark (%) you have to use two of them

Unicode

The language files can be saved in the unicode-format UTF-8. When loading the file there will be an automatical change of the current font. A full unicode-support we can't give.

Creating of new language files

To select a language in the online-updater (config.exe), the new language file has to be in the config language directory. If you want to translate X-Force into a language not yet listed you should start with the language file for the online-updater (config.exe).

To create a new language file it's recommended to copy an already existing language file as a starting point. You should take either the german or the english file because their are usually the latest versions. In other (older) language files there might be constants missing (missing constants are listed when the game starts).

In a new language file you should mark all lines with the (new) tag after the copying. That makes it easier to find missing translations at a later time. And anyone can find out the status of the translation by counting lines with and without (new).

You can enter the tag by search and replace. In textpad you can use the following regular expression (the option regular expression has to be active):

Search for: ^\([^=]+=\)
Replace by: \1(new)

If you have a texteditor that doesn't support regular expressions, you can use the simple search & find:

Search for: =
Replace by: =(new)

This second variant has the disadvantage that it replaces any "=" within texts with "=(new)", even those cases where = is part of the text. If a translator finds several "=" in one line and each one has a "(new)" following, the translator has to delete the additional tags.

Translating the gamesets


Recent Changes - Edit Menue
Page last modified on 26.08.2007, 11:46 by DirkF
Edit Page - Attributes - Page History