language_pack - Damir-k/hacker-simulator-v2 GitHub Wiki
Language_pack is a .json file that contains the information about the text used in the game.
In this tutorial I will show the steps needed to create your language_pack.
First make sure your custom language is supported by utf-8 encoding.
File name MUST:
- start with any number, followed by an "_" (don't choose any numbers that are already used by other languagepacks in your folder).
- have a custom name after the "_" (note that the custom name MUST NOT contain characters such as "." or "_")
- end with ".json" (obviously)
Here are some examples of possible file names:
0_english.json, 1_русский.json, 2_français.json
Please note: an inappropriate file name may cause the game to crash at any moment.
Let's take a look at the original 0_eng.json (this is what it looked like at the beginning of the project, at least):
{
"yes": "yes",
"no": "no",
"0": "Create new save [1]",
"1": "Load existing save [2]",
"2": "Choose your save name",
"3": "This save already exists. Overwrite? [yes/no]",
"4": "Select your save"
}
As you can see, the file consists of pairs of "key": "value" separated by commas. What you need to do is change the values. All keys must be the same, otherwise IndexError will occur. The following is an example of a Spanish language_pack (I don't know Spanish, this is google translated):
{
"yes": "si",
"no": "no",
"0": "Crear nuevo guardar [1]",
"1": "Сargar guardar existente [2]",
"2": "Elige un nombre para guardar",
"3": "Este guardado ya existe. Sobrescribir guardar? [si/no]",
"4": "Elige tu guardar"
}
Once you have done all of the steps listed above, your language_pack will show up in the game. Enjoy!