Fusion modding · UNITS / AVIA / LAND/DOM / ANIMAT / EXPLOSIONS
FrançaisLanguages and names (desc.lng)
Since version 4.5.6, you can play Fusion in French or in English. The names of units and buildings are not in the sheets now: each sheet gives a key, and the game reads the text of that key in a language file. All players keep the same archives: a network game between a French player and an English player does not go out of sync.
This does not apply to maps, missions and briefings (missiontexts.lng, mis_unitnames).
Keys in the sheets
A value that starts with $ is a key. The game replaces it with its text, on all the lines of the sheet:
name $N_m4
shortname $S_m4
Name obj 12 $H_Atelier
Fusion names its keys as follows:
| Key | Contents | Example |
|---|---|---|
N_<file> | full name of a unit | N_m4 |
S_<file> | short name of a unit | S_m4 |
H_<name> | name of a building | H_Atelier |
<file> is the file name of the sheet, in lower case (dots, dashes and (t) included). A name in plain text (name "Tigre personnalise") still operates, but it does not get a translation.
Language files
- French, the base language:
lang2/desc.lng, inlang2.aps. It has all the keys. - Another language:
Run/APRM/i18n/<code>/desc.lng(for examplei18n/en/), a folder that all players get. It has only three files:desc.lng,game.lng(messages and menus during a mission) andmenures.lng. - The language selection: the launcher and the RUI menu write two lines in
sudtest.ini:
[Game]
Language=en
[data]
Common=i18n\en\
The game mounts the Common folder before its archives: a file in i18n\en\ replaces the same file of lang2.aps. For French, Common= stays empty. The game reads these lines again each time a mission loads.
desc.lng format
N_m4 Supply vehicle M4 18t
S_m4 M4
H_Atelier Workshop
- One line for each key: the key, then a space or a tab, then the text.
- The file is in UTF-8, with no BOM. Accented letters show correctly.
- A line that starts with a space or a tab continues the text of the line before it. Do not use this in
desc.lng. - If a key occurs two times, only the first one is used.
- Typographic quotes and punctuation (
« » „ “ ’ – €) show as?: use ASCII punctuation. Textured button fonts have no lower case.
Add a unit
- In the sheet, write
name $N_<file>andshortname $S_<file>. - Add the two keys, in French, to
lang2/desc.lng. - Add the two keys, translated, to
i18n/en/desc.lng. - Run
python3 tools/i18n_check.pyin the root folder of Fusion. It must end with no error.
Engine limits
| Limit | Value | Result if you go above it |
|---|---|---|
| Full name of a unit | 63 bytes | the text is cut |
| Short name of a unit | 12 bytes | the engine cuts it, sometimes in the middle of an accented letter (2 bytes) |
| Name of a building | 31 bytes | the text is cut |
game.lng + desc.lng of one language | 200 KB recommended | the shared 256 KB buffer has no check |
| Keys | identified by their CRC-32 | two keys with the same CRC: the second one is lost |
A key that desc.lng does not have no longer stops the game: the unit shows its key ($N_m4), which tells the modder what to add. A building with a missing key has no name.
In game.lng, keep for each key the same %d, %s, ~KEY_xx~, ~clr V1~ and \n as the French text.