Introduction:
Translations can be done in two ways; as a normal translation (in the 'locale' folder) or as a mod that includes the translation (Mod translation).
The difference between them is that the normal one can be changed from a specific list in the launcher (see image below) and allows translations of the launcher text, however, it needs to be placed manually in the game folder.
The advantage of being a mod is the easiness that brings the Steam Workshop for uploading and keep it up to date.
The decision is up to you.

Note: It's not recommended to combine both options.
All the displayed strings come from two places: the source code (SC) and and the game data (in the Forgotten Construction Set (FCS)).
The SC's strings are mostly messages, titles, and similar stuff. The strings in game data are basically all the game content and the dialogue (everything in the FCS).
Both of this are handled different; the SC strings are loaded using a specific library (more on that below) while the game data are loaded similar to a mod (with a different extension).
Format:
The strings to be translated are generated using the 'Boost Locale' library that uses GNU gettext formatting.
There are a bunch of tools and editors to translate and update the files quite easily.
- Files:
There are three types that are handled: pot, po and mo.- 'pot' (Portable Object Template) file, which contains a list of all the translatable strings extracted from the sources and game data.
- 'po' (Portable Object) file contains the translated strings (from the .pot file) for a specific language. This files are created (an can be updated) from a .pot file.
- 'mo' (Machine Object) file contains the binary-compiled .po translation file.
If you want more info on the format or how it works you can google it. - Folder's naming:
The format for the locale content folder will use the structure 'language_COUNTRY' where language is ISO-639 language name like "en" or "ru", COUNTRY is the ISO-3166 country identifier like "US" or "DE". The country identifier is optional if you want to make a country specific translation for the same language.
Examples: de_DE, zh_HANS, ru_RU, es_ES, en_US.
Note: If the country is not added to the name, the number formatting, like decimal and thousands separators, won't be display in the locale.
There are a few tools for translating this files:
- I've recommend Poedit; it handles creating new translations as well as updating from a pot file.
- There is also Google Translator Toolkit online tool that allows collaboration with multiple people (like a Google Doc file) and some other features. If you want to use this last one, since for some reason it doesn't support the .pot extension, you need to change the extension from .pot to .po from the base files when you upload them.
There are two ways of translating the game data strings (the ones in the FCS); one is creating a normal mod and replace all the names, descriptions, dialogue lines, etc. by hand.
The other option is to use the FCS tool to extract all the base strings (i.e. non-dialogue) strings to a pot file and the translation mode in the FCS to do the dialogue lines.
The latter is a better option since it will extract strings that are used in game in the pot format and it provides an easier way to translate dialogue.
Note: Technically both options are compatible with both ways of doing translations as described in the introduction.
- Introduction
The translation of the game data is splitted in to parts; one is the base game data (everything that is not a dialogue) and the dialogue.
The base game data is extracted to a POT for easier translation. It has only the used strings and there are no repeated lines.
The dialogue translation is done using the Translation mode in the FCS. It works similar to the normal FCS mode except it will only show used dialogues and words swaps, an for each of them, it'll show the original and translated string.
Note: To extracts the base game data strings is also needed to be in Translation Mode in the FCS.
Since the SC's strings are already shipped with the game (in the file 'main.pot' that is located in 'Kenshi\locale\en_GB\LC_MESSAGES'), you'll need to decide if you want to extract the game data strings or make a mod directly as commented above.
The decision is up to you.
This guide will asume that you'll use the Translation Mode in the FCS. - Activate 'Translation Mode':
- Open FCS

Or open "forgotten construction set.exe" in the Kenshi folder. - Check the checkbox 'Enable' on the bottom part. (Note: If you load any other mod, the content of that mod will also be extracted and is not recommended)

You can add a new translation or select an existing one to update.
The translation files will be in Kenshi\__translations\<locale>\ folder.
- Open FCS
- Extracting strings:
To extract the game data strings follow this steps:- Press the toolbar button 'Translations'

- Press "Export" button.


The gamedata.pot contains all the items, buildings, races, towns, etc. names and descriptions (if they have).

Note: If the "Export dialogue" option is selected, it will export the dialogue lines to .pot files in the dialogue folder.
Important note: There are text files in the data folder like 'tips.txt', 'namesF.txt', etc. that need to be directly translated (without using the .pot/.po format) (See part 4 for how to include them). - Press the toolbar button 'Translations'
- Translating:
Game base data:
You'll need to create a translation (.po) file for the gamedata.pot file. You can use the Poedit or any similar tool to do this.
Translation notes: In the strings, the content inside braces ({}) represents some value that is replaced in game with some other content. It can be from numbers, names, actions, etc. The braces plus their content should not be modified, although the can be placed in different location in the text. E.g.: "Lockpicking (Chance {1}%)" in Spanish could be translated as: "Forzando cerradura ({1}% de probabilidad)".
Alseo, all non-translated strings (empty string "") in the .po files will be show the original string in English (both from the main.po and the game data extracted/build from the FCS).
Dialogue:
When opening the FCS in Translation Mode, it will show the main window with just to categories: Dialogues and Word Swaps.

To translate them, just double click on one and it will display the following window:

The top bar displays information for the selected dialogue node, like who is speaking, if the target is a specific type/race/gender or meets other conditions. This information gives better context for when translating.
On the bottom left is the dialogue tree with the respones/paths for the dialogue. If the node has a red dotted rectangle around the name it means that there are strings that need translating yet. Whether because they wheren't translated yet or if the base string changed.
On the bottom right displays all the possible variations for the selected node. All of them have the same probability of showing in game when the node is executed.
If the line is blue, it means that the line needs translation (the same as the node). Once all the lines are translated, the node red dotted rectangle will disappear.
Important note: To apply the translation is necessary to press "Enter", otherwise the changes won't apply. This also applys for lines that stay the same when translated.

Translation notes: Some lines in the dialogue contains strings in between slashes (/) like /HELL/ or /YOUTHERE/, this represent word swaps. This word swaps are randomly or context-based replaced in game by other words. Similar to the braces, this should be maintained the same inside and can be moved.
Word swaps:
The word swaps are dialogue lines that contain swapping words for the main dialogue.
As with the dialogue, they have different lines with conditions. - Importing:
To import the translated gamedata.po file into the translation mod, follow this steps:
- Place the translated gamedata.po file in the same folder as the .pot file was exported (Kenshi\__translations\<locale>\)

- Open the Import/Export translation window (the same as in the exctraction part)

- Press "Import" button.

If you want to see the changes in the FCS, activate Translation Mode but before clicking on the Done button, hold Alt key and then click on the button. This will load the translation as a normal mod.
Special note: If you used the previous system where it exported a dialogue folder and have translation of those, place the dialogues folder in the same location as the gamedata.po file and use the import function. This will add those translations to the translation mod. The translated strings that are the same as the base ones will show as non-translated in the editor. - Place the translated gamedata.po file in the same folder as the .pot file was exported (Kenshi\__translations\<locale>\)
- Packing:
Once you finished translating or want to make a partial release, you'll need to save the changes in the FCS and place all the files in the corresponding folders.- Create the final folder (output folder):
- If you are creating a normal translation, create a folder in Kenshi\locale\ with the name in the format specified in the Format/Folders section above.
E.g.: Kenshi\locale\fr-FR\ - If you are creating a mod translation, create a folder named locale in your mod folder (e.g. Kenshi\mods\<mytranslationmod>) with a folder inside with the name in the format specified in the Format/Folders section above.
E.g.: Kenshi\mods\<mytranslationmod>\locale\fr-FR\
- If you are creating a normal translation, create a folder in Kenshi\locale\ with the name in the format specified in the Format/Folders section above.
- Copy the translation result files:
- Copy the .translation file in the output folder (created in step 3.1). If you didn't extracted/built the files using the FCS tool, ignore this step.
- Create a folder under the output folder (step 3.1) named LC_MESSAGES
- Copy the translated main.mo file (note that is the .MO file, NOT the .po file) into the LC_MESSAGES folder.
- Normal translation
Code: Select all
Kenshi \---locale \---ru | ru.translation | \---LC_MESSAGES main.mo - Mod translation
Code: Select all
Kenshi \---mods \---my_russian_translation | my_russian_translation.mod | \---locale \---ru | ru.translation | \---LC_MESSAGES main.mo
- Create the final folder (output folder):
- Extra content
Because the fonts shipped with the game (and maybe other content) doesn't support all languages, you'll probably need to modify or add new content to your mod/translation.
Luckily both type (normal and mod translation) support modifying or adding extra game files easily:- For Mod translations, since it's works the same as a mod, you just need to create the folders on the mod folder using the same structure and placing the files you want to add or replace. (E.g.: Kenshi\mod\mymod\ ~= Kenshi\data\)
- For Normal translations, the output folder will behave the same as the mod folder. (E.g.: Kenshi\locale\ru\ ~= Kenshi\data\)
In this case what I'm going to do is add extra fonts to support Russian alphabet.
If you check the current fonts in the game (Kenshi/data/gui/fonts/), only one of them supports Cyrillic alphabet (Exo2), however, if you check kenshi_fonts.xml (this is the file that is loaded by the game and contains all the information of the fonts) for that font it only uses the character code range 32 to 126 which don't include the Cyrillic characters. To fix this we need to add those character ranges.- Before:
Code: Select all
<Code range="32 126"/> - After:
Code: Select all
<Code range="32 126"/> <Code range="1024 1279"/>
For the two other fonts used, we need to choose new ones (https://fonts.google.com/ is a good source of nice free fonts) and modify kenshi_fonts.xml to use those new fonts (and also add the character codes ranges).
Once we finish with that, the last step is to copy them to the locale/mod output folder.
The result will be something like this:- Normal translation
Code: Select all
Kenshi \---locale \---ru | ru.translation | tips.txt | namesF.txt | namesM.txt | namesMF.txt | +---gui | \---fonts | kenshi_fonts.xml | pretty_font_with_cyrilic_chars.ttf | some_font_with_cyrilic_chars.ttf | \---LC_MESSAGES main.mo - Mod translation
Code: Select all
Kenshi \---mods \---russian | russian.mod | tips.txt | namesF.txt | namesM.txt | namesMF.txt | +---gui | \---fonts | kenshi_fonts.xml | pretty_font_with_cyrilic_chars.ttf | some_font_with_cyrilic_chars.ttf | \---locale \---ru | ru.translation | \---LC_MESSAGES main.mo
Note 2: I've included tips.txt, namesF.txt, etc. as an example of other files that can be modified. - Share and profit?
Upload it to Steam Workshop, to another site or do whatever you want with it.
- The locale folder with name 'en-GB' will be ignored since the game is already in English. You can still create a country variation for English. (I.e.: en-US, en-AU, etc.)
- How can I make the FCS as portable as possible?
You just need the following files:(*) Only needed for the Steam version.Code: Select all
Kenshi | CSteamworks.dll.dll (*) | DialogConditionControl.dll | forgotten construction set.exe | NLog.dll | PropertyGrid.dll | steam_api.dll (*) | Steamworks.NET.dll (*) | +---data | Dialogue.mod | gamedata.base | Newwworld.mod | rebirth.mod | \---__translations \---es_ES ...
Note: The folder structure needs to be maintained.
02/02/2017 - Added FAQ for making it portable
06/12/2016 - Dialogue translation update
- Now the translations are made on the FCS directly. (This way is easier to get the context.)
- This will run FCS in a special mode where you can see all the dialogue lines and word swaps and modify them seeing the original strings.
- The export will only export base game data (i.e. non-dialogue stuff). The import function will import base and dialogue translations (for legacy translations).
- Now the you will be able to add new line options for the dialogue lines for your language.

