Add more detailed documentation for translations

This commit is contained in:
Ivan Savenko
2026-05-21 21:33:33 +03:00
parent ed88184373
commit 086278d5b0
6 changed files with 297 additions and 246 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ Lobby is currently hosted on Hetzner, with migration of other services to Hetzne
| VPS | Location | Specifications | Services |
| --- | -------- | -------------- | -------- |
| `vcmi-forum` | DO Droplet | 2 Gb / 1 CPU / 25 Gb / $12 (+20%) | [Discourse forum](https://forum.vcmi.eu/). Note: 25 Gb droplet - ssd can be expanded, or we can downscale entire droplet to 1 Gb config |
| `vcmi-weblate` | DO Droplet | 2 Gb / 1 CPU / 50 Gb / $12 | [Weblate](https://weblate.vcmi.eu/) |
| `vcmi-weblate` | DO Droplet | 4 Gb / 2 CPU / 50 Gb / $24 (+20%) | [Weblate](https://weblate.vcmi.eu/) |
| `vcmi-web` | DO Droplet | 512 Mb / 1 CPU / 10 Gb + 100 Gb / $4 (+20%) + $10 | Builds uploading from Github, [Build download page](http://download.vcmi.eu/), [Legacy download page](https://builds.vcmi.download/). Also contains nginx server for redirecting [old bug tracker](https://bugs.vcmi.eu/), [old wiki](https://wiki.vcmi.eu/), and [old slack invite page](https://slack.vcmi.eu/) |
| `vcmi-lobby` | Hetzner Server | 4 Gb / 2 CPU / 40 Gb / €4 (+20%) | Multiplayer lobby (lobby.vcmi.eu or beholder.vcmi.eu - deprecated) as we ll as [API endpoint](https://api.vcmi.eu/) |
| `vcmi-artifactory` | DO Snapshot | 4 Gb / 2 CPU / 80 Gb / $24 | [Conan Artifactory server](https://artifactory.vcmi.eu/) |
+3 -3
View File
@@ -1,7 +1,7 @@
# Discourse
# Weblate
- RAM requirements: 2 GB + swap, official docs recommend 3 Gb
- CPU requirements: 1 core, official docs recommend 2 cores.
- RAM requirements: 4 GB, may run at 2 Gb, but performance is poor
- CPU requirements: 2 core, may tun at 1 core but performance is poor
- SSD requirements: over 10 GB. Will grow over time with more translations
Accessible as [weblate.vcmi.eu](https://weblate.vcmi.eu/)
+82
View File
@@ -0,0 +1,82 @@
# Translation of Heroes III
## Translation of Heroes III text data
VCMI maintains translation of Heroes III text files to all supported languages on the Weblate. To join translation, register on [our Weblate](https://weblate.vcmi.eu) and start translating into your language.
Heroes III translation can be located at [Heroes III project in our Weblate](https://weblate.vcmi.eu/projects/heroes-of-might-and-magic-3/#languages). This link is only accessible for registered accounts. Creating a new account should automatically grant you access to this project.
This translation includes:
- Base game data, such as names of heroes, creatures, artifact, and all in-game messages that you can encounter on any map
- Translation of maps distributed with Heroes III Complete
- Translation of RoE, AB, and SoD campaigns
- As well as translation of Chronicles, designed for use with Chronicles imported into VCMI using gog installer
Changes made via Weblate will be automatically added to corresponding translation mod in 24 hours or less.
If you have already existing Heroes III translation you can:
- Install VCMI and select your localized Heroes III data files for VCMI data files
- Launch VCMI and start any map to get in game
- Press Tab to activate chat and enter `/translate`
After that, start VCMI Launcher, switch to Help tab and open "log files directory". You can find exported json's in `extracted/translation` directory. To export maps and campaigns, use `/translate maps` command instead. Once export is complete, you can import generated files into Weblate. Make sure to select correct language and component before uploading exported json file.
## Translation of images
To translate them, do the following:
- Download your translation mod, located in [VCMI Mods on Github](https://github.com/vcmi-mods)
- Copy text-free images from [empty translation](https://github.com/vcmi-mods/empty-translation)
- Replace images in data and sprites with translated ones (or delete it if you don't want to translate them now)
- Upload modified images to your translation mod
For all images recommended format is .png. See [File Formats](../modders/File_Formats.md#images) for details. Make sure to preserve image dimensions, and if present - image palette when editing text-free images.
If you can't produce some content on your own:
- Create a `README.md` file at the root of the mod
- Write into the file the translations and the **detailled** location
This way, a contributor that is not a native speaker can do it for you in the future.
## Translation of in-game audio
- Download your translation mod, located in [VCMI Mods on Github](https://github.com/vcmi-mods)
- Check [empty translation](https://github.com/vcmi-mods/empty-translation) for information on audio (filename, text, speaker character)
- Record or generate audio files
- Placed created files into `content/sounds` directory of your translation mod
- Upload changes in your translation mod
For all audio recommended format is .ogg. See [File Formats](../modders/File_Formats.md#sounds) for details.
If you can't produce some content on your own:
- Create a `README.md` file at the root of the mod
- Write into the file the translations and the **detailled** location
This way, a contributor that is not a native speaker can do it for you in the future.
## Custom fonts
VCMI built-in font covers most languages that use European scripts - Latin, Cyrillic, Greek, etc. Other languages may need additional fonts.
You can verify this by launching VCMI, starting any map in single-player, pressing Tab to open game change and typing entire alphabet. On mobile systems you can tap on chat panel to activate it (brown area below adventure map)
If there are missing glyphs - you may need to provide own fonts. For this please locate any font with free license, such as OFL, and add font similar to one of existing mods, such as Vietnamese: <https://github.com/vcmi-mods/vietnamese-translation/tree/vcmi-1.4/vietnamese-translation/mods/VietnameseTrueTypeFonts>
## Video subtitles
It's possible to add video subtitles. Create a JSON file in `video` folder of translation mod with the name of the video (e.g. `H3Intro.json`):
```json
[
{
"timeStart" : 5.640, // start time, seconds
"timeEnd" : 8.120, // end time, seconds
"text" : " ... " // text to show during this period
},
...
]
```
+91
View File
@@ -0,0 +1,91 @@
# Translation Maintenance
NOTE: Operations described here require admin access to either VCMI on Github or to Weblate and can only be done by VCMI Team
### Engine support for new languages
In order to add new language it needs to be added in multiple locations in source code:
- Generate new .ts files for launcher and map editor, either by running `lupdate` with name of new `.ts` or by copying `english.ts` and editing language tag in the header.
- Add new language into `lib/Languages.h` entry. This will trigger static_assert's in places that needs an update in code
- Add new language into json schemas validation list - settings schema and mod schema
- Add new language into mod json format - in order to allow translation into new language
Also, make full search for a name of an existing language to ensure that there are no other places not referenced here
### Heroes III data translation support
To create translation mod for a new language, easiest approach is to:
- Create new mod, using mod.json from existing translation such as [English](https://github.com/vcmi-mods/h3-for-vcmi-englisation) as base
- Mod ID must be `<language>-translation`, mod name must be `<Language> translation`.
- Change "language" field to language ID of new language, make sure that "modType" is set to "Translation"
- Add empty Json files ( `{}` ) named `game.json`, `campaigns.json`, `maps.json`, and `chronicles.json` to directory `content/translation/`
- Upload mod files to mod repository
### Translating the Installer
VCMI uses an Inno Setup installer that supports multiple languages. To add a new translation to the installer, follow these steps:
1. **Download the ISL file for your language:**
- Visit the Inno Setup repository to find the language file you need:
[Inno Setup Languages](https://github.com/jrsoftware/issrc/tree/main/Files/Languages).
2. **Add custom VCMI messages:**
- Open the downloaded ISL file and include the necessary VCMI-specific custom messages.
- Refer to the `English.isl` file in the repository for examples of required custom messages.
- Ensure that all messages, such as `WindowsVersionNotSupported` and `ConfirmUninstall`, are correctly translated and match the functionality described in the English version.
3. **Modify the `ConfirmUninstall` message:**
- The VCMI installer uses a custom Uninstall Wizard. Ensure the `ConfirmUninstall` message is consistent with the English version and accurately reflects the intended functionality.
4. **Modify the `WindowsVersionNotSupported` message:**
- Translate and update this message to ensure it aligns with the intended warning in the English version.
5. **Add the new language to the installer script:**
- Edit the `[Languages]` section of the Inno Setup script.
- Add an entry for your language, specifying the corresponding ISL file.
Example syntax for adding a language:
```text
[Languages]
Name: "english"; MessagesFile: "{#LangPath}\English.isl"
Name: "czech"; MessagesFile: "{#LangPath}\Czech.isl"
Name: "<your-language>"; MessagesFile: "{#LangPath}\<your-language>.isl"
```
### Addition of new mods to Weblate
Requires admin access to Weblate. All fields can be edited later in Weblate project settings
- Create new project on Weblate:
- Project name: name of the mod
- Project slug: mod ID
- Project website: mod page in vcmi-mods org
- Create new component:
- Version control system: `Git`
- Source code repository: `https://github.com/vcmi-mods/mod-name.git`
- Repository branch: `vcmi-1.x`. This is branch from which Weblate will take translations
- On next page, select `Json nested structure file` with path pattern `content/translation/*.json`
- Repository push URL: `https://github_pat_***@github.com/vcmi-mods/horn-of-the-abyss.git` (replace *** with token from existing project. WARNING: DO NOT share exact URL anywhere, or specifically - private github PAT)
- Push branch: `vcmi-1.x`. This is branch to which Weblate will upload translations
- Rest of options are the same as with addition of new submods
With this configuration, Weblate will automatically push changes every 24 hours after first change to `vcmi-1.x` branch
### Addition of new submods to Weblate
Requires admin access to Weblate
On Weblate add new component and configure it as follows. If you have not set any of these fields, they can be edited later in Component -> Settings -> Files tab.
- Source code repository: `weblate://mod-name/mod-name`
- On next page, select `Json nested structure file` with path pattern:
- File mask: `mods/XXX/content/translation/*.json` for submods.
- File mask: `mods/XXX/mods/YYY/content/translation/*.json` for submods of submods
- Json indentation: `1`
- Json indentation style: `Tabs`
- Monolingual base language file: `mods/XXX/content/translation/english.json` for submods, or `mods/XXX/mods/YYY/content/translation/english.json` for submods of submods.
- Edit base file: `off`
- Adding new translation: `Disable adding new translations`
+96
View File
@@ -0,0 +1,96 @@
# Translation of VCMI mods
## Translation of mods via Weblate
Translation for some mods is being migrated to our self-hosted [Weblate](https://weblate.vcmi.eu/projects/).
If mod that you wish to translate is already there and it already has your language, then all you need to do is register and start translating. Changes made via Weblate will be automatically added to corresponding mod in 24 hours or less.
If you wish to add a new mod on our Weblate, please contact VCMI Team for initial setup via Discord or Github.
### Initial setup
Before starting, go through this checklist to ensure that mod is ready for Weblate:
- mod must be hosted by vcmi-mods Github organization
- mod must contain mod.json in top-level directory, and not in a subdirectory
- mod must use centralized workflow from <https://github.com/vcmi-mods/workflow>
- make sure that workflow has generated `content/translation/english.json` with exported English strings of your mod repo
- add empty .json for every language to which you wish to translate. See below for details
Once everything is ready, please contact VCMI Team via Discord or Github to finish the process
### Addition of new languages
This operation can be done by anyone with write access to mod repository. You can also create new pull request and ask for someone with write access to accept it.
If translation to a new language needs to be added to Weblate, please add empty dummy files for required language to mod repository on Github. This should automatically generate translation on Weblate once changes are merged. You can do this:
- Manually, by creating empty .json file with `{}` as content next to every english.json in your mod (usually - only in main mod, but in some cases submods may also need separate translation)
- By running python script locally: `python3 .github/add_translations.py --root . --lang <language>` (script available in any mod that uses VCMI mod workflow)
- By running "Add new language to translation" workflow in mod repository with desired language (requires admin permissions)
For language tag format always use full name of language in English, in lower case. Examples: `english`, `polish`, `chinese`
Note that while Weblate supports basically any language, VCMI only supports limited set of languages listed in [Translations.md](Translations.md)
### Addition of new submods
If you have added new submod that needs translating to mod you are working on, add required files (english.json generated by translation export and any required dummy translations) to mod repository on Github. Please use the same list of translations as for the rest of the mod.
Once new files are up, please contact VCMI Team via Discord or Github to finish the process and add new component for the submod on Weblate
WARNING: Do not edit or move translation files other than through Weblate. If you have to, for example due to submod reorganization, please contact VCMI Team.
## Translating mods manually
### Exporting translation
If you want to start new translation for a mod or to update existing one you may need to export it first. To do that:
- Optionally, backup your mod preset - game may modify active submods of mod being translated
- Set game language in VCMI Launcher to one that you want to target
- launch VCMI server in translation export mode:
- (Windows) Create shortcut for VCMI_Server.exe and append `--translate-mod=XXX` to "Target" field in shortcut properties, where XXX is identifier of mod that you want to translate
- (Other platforms) Open command line and run `vcmiserver --translate-mod=XXX`, where XXX is identifier of mod that you want to translate
After that, start VCMI Launcher, switch to Help tab and open "log files directory". You can find exported json's in `extracted/translation` directory.
### Exporting translation (alternative)
Alternatively, you can use vcmi client to do similar actions:
- Enable mod(s) that you want to export and set game language in Launcher to one that you want to target
- Launch VCMI and load any map to get in game
- Press Tab to activate chat and enter '/translate'
After that, start VCMI Launcher, switch to Help tab and open "log files directory". You can find exported json's in `extracted/translation` directory.
If your mod also contains maps or campaigns that you want to translate, then use `/translate maps` command instead.
If you want to update existing translation, you can use `/translate missing` command that will export only strings that were not translated
NOTE: when translating with this method, some strings may not export correctly, for example strings that were modified in multiple mods. To avoid this, you'll need to disable mods that override other strings and do a second re-run of this command
### Translating mod information
In order to display information in VCMI Launcher in language selected by user add following block into your `mod.json`:
```json
"<language>" : {
"name" : "<translated name>",
"description" : "<translated description>",
"author" : "<translated author>",
"translations" : [
"translation/<language>.json" // NOTE: path is relative to content directory
]
},
```
However, normally you don't need to use block for English. Instead, English text should remain in root section of your `mod.json` file, to be used when game can not find translated version.
### Translating in-game strings
After you have exported translation and added mod information for your language, copy exported file to `<mod directory>/content/translation/<language>.json`.
Use any text editor (Notepad++ is recommended for Windows) and translate all strings from this file to your language
+24 -242
View File
@@ -1,269 +1,51 @@
# Translations
## List of currently supported languages
VCMI supports translations into multiple languages. Most of our translations are provided by our community, so progress depends a lot on availability of volunteers to do the translations. If language you're interested in is lagging behind - feel free to join and start translating.
This is list of all languages that are currently supported by VCMI. If your languages is missing from the list and you wish to translate VCMI - please contact our team and we'll add support for your language in next release.
## Translation of VCMI
- Belarusian
- Bulgarian
- Czech
- Chinese (Simplified)
- Dutch
- English
- Filipino
- Finnish
- French
- German
- Greek
- Hungarian
- Italian
- Japanese
- Korean
- Latvian
- Norwegian
- Polish
- Portuguese (Brazilian)
- Romanian
- Russian
- Serbian
- Spanish
- Swedish
- Turkish
- Ukrainian
- Vietnamese
[![VCMI translation status](https://hosted.weblate.org/widget/vcmi/multi-auto.svg)](https://hosted.weblate.org/engage/vcmi/)
## Progress of the translations
You can see the current progress of the different translations here:
[Translation progress](https://github.com/vcmi/vcmi-translation-status)
The page will be automatically updated once a week.
## Translating Heroes III data
VCMI allows translating game data into languages other than English. In order to translate Heroes III in your language easiest approach is to:
- Copy existing translation, such as English translation from here: <https://github.com/vcmi-mods/h3-for-vcmi-englisation> (delete sound and video folders)
- Copy text-free images from here: <https://github.com/vcmi-mods/empty-translation>
- Rename mod to indicate your language, preferred form is "(language)-translation"
- Update mod.json to match your mod
- Translate all texts strings from `game.json`, `campaigns.json` and `maps.json`
- Replace images in data and sprites with translated ones (or delete it if you don't want to translate them)
- If unicode characters needed for language: Create a submod with a free font like here: <https://github.com/vcmi-mods/vietnamese-translation/tree/vcmi-1.4/vietnamese-translation/mods/VietnameseTrueTypeFonts>
If you can't produce some content on your own (like the images or the sounds):
- Create a `README.md` file at the root of the mod
- Write into the file the translations and the **detailled** location
This way, a contributor that is not a native speaker can do it for you in the future.
If you have already existing Heroes III translation you can:
- Install VCMI and select your localized Heroes III data files for VCMI data files
- Launch VCMI and start any map to get in game
- Press Tab to activate chat and enter `/translate`
This will export all strings from game into `Documents/My Games/VCMI/extracted/translation/` directory which you can then use to update json files in your translation.
To export maps and campaigns, use `/translate maps` command instead.
### Video subtitles
It's possible to add video subtitles. Create a JSON file in `video` folder of translation mod with the name of the video (e.g. `H3Intro.json`):
```json
[
{
"timeStart" : 5.640, // start time, seconds
"timeEnd" : 8.120, // end time, seconds
"text" : " ... " // text to show during this period
},
...
]
```
## Translating VCMI data
VCMI game data is translated via [Weblate](https://hosted.weblate.org/projects/vcmi/).
VCMI comes with own Launcher, Map Editor, as well as some numerous game UX improvements, some of which required addition of new strings. All such texts can be translated for any language supported by VCMI. To join translation, register on [Hosted Weblate](https://hosted.weblate.org/projects/vcmi/) that is hosted by Weblate Team, and start translating.
For usage of Weblate, please refer to [Weblate documentation](https://docs.weblate.org/en/latest/user/translating.html)
If something is not clear - feel free to ask us on Discord or forum. Translation made via Weblate will be automatically integrated into VCMI for next release
## Adding new languages
## Translating mods via Weblate
If you wish to translate VCMI into new language, first step is to contact VCMI Team via Discord or Github to add a new language. Once done, you should be able to select your language in VCMI Launcher in next daily build, and eventually - in next release.
Translation for some mods is being migrated to our self-hosted [Weblate](https://weblate.vcmi.eu/projects/). If mod that you wish to translate is already there and it already has your language, then all you need to do is register and start translating.
In general, VCMI can support any language with left-to-right script. Languages with right-to-left script such as Arabic are currently not supported by engine and would require developers to implement support for such languages in VCMI.
If you wish to add a new mod on our Weblate, please contact VCMI Team for initial setup via Discord or Github.
If something is not clear - feel free to ask us on Discord or forum. Translation of VCMI itself made via Weblate will be automatically integrated into VCMI for next release
### Initial setup
## Translation of Heroes 3
Before starting, go through this checklist to ensure that mod is ready for Weblate:
[![Heroes of Might and Magic 3 translation status](https://weblate.vcmi.eu/widget/heroes-of-might-and-magic-3/multi-auto.svg)](https://weblate.vcmi.eu/engage/heroes-of-might-and-magic-3/)
- mod must be hosted by vcmi-mods Github organization
- mod must contain mod.json in top-level directory, and not in a subdirectory
- preferrably, mod should use centralized workflow from <https://github.com/vcmi-mods/workflow>
- export English strings by running `vcmiserver --translate-mod=mod-name` and moving all generated `english.json` files to your mod
- create dummy .json for each language to which you wish to translate in every submod that has translatable strings
VCMI maintains translations of Heroes of Might and Magic 3 into all languages supported by VCMI, with different level of completeness. To join translation, register on [our Weblate](https://weblate.vcmi.eu) and start translating.
This operation can only be done by VCMI Team. Only mods hosted by vcmi-mods org can be translated this way.
Check [Heroes III translation guide](Game_Translation.md) on how to translate content other than texts.
- Create new project on Weblate:
- Project name: name of the mod
- Project slug: mod ID
- Project website: mod page in vcmi-mods org
- Create new component:
- Version control system: `Git`
- Source code repository: `https://github.com/vcmi-mods/mod-name.git`
- Repository branch: `vcmi-1.x`. This is branch from which Weblate will take translations
- On next page, select `Json nested structure file` with path pattern `content/translation/*.json`
- Repository push URL: `https://github_pat_***@github.com/vcmi-mods/horn-of-the-abyss.git` (replace *** with token from existing project)
- Push branch: `vcmi-1.x`. This is branch to which Weblate will upload translations
- Rest of options are the same as with addition of new submods
## Translation of VCMI Mods
### Addition of new languages
Currently following mods are being translated via Weblate hosted by VCMI Team. To join translation, simply register on [our Weblate](https://weblate.vcmi.eu) and start translating. If your language is missing from the list, please contact either mod authors or VCMI Team on Discord. If you need help, check our [mod translation guide](Mod_Translation.md) or ask our community on Discord
This operation can be done by anyone with write access to mod repository. You can also create new pull request and ask for someone with write access to accept it.
If you are modder and wish to add your mod, please contact VCMI Team on Discord. If possible, try to make all preparation steps as described in [mod translation guide](Mod_Translation.md)
If translation to a new language needs to be added to Weblate, please add empty dummy files for required language to mod repository on Github. This should automatically generate translation on Weblate once changes are merged.
### Horn of the Abyss
Note that while Weblate supports basically any language, VCMI only supports limited set of languages listed in this document
#### Translation progress for Horn of the Abyss (excluding maps and campaigns)
### Addition of new submods
[![Horn of the Abyss translation status](https://weblate.vcmi.eu/widget/horn-of-the-abyss/horn-of-the-abyss/multi-auto.svg)](https://weblate.vcmi.eu/engage/horn-of-the-abyss/)
This operation can only be done by VCMI Team
#### Full translation progress of Horn of the Abyss (including maps and campaigns)
If there is a new submods that needs translating, add required files (english.json and any required dummy translations) to mod repository on Github. Please use the same list of translations as for the rest of the mod.
[![Horn of the Abyss translation status](https://weblate.vcmi.eu/widget/horn-of-the-abyss/multi-auto.svg)](https://weblate.vcmi.eu/engage/horn-of-the-abyss/)
After that, on Weblate add new component and configure it as follows. If you have not set any of these fields, they can be edited later in Component -> Settings -> Files tab.
### In the Wake of Gods
- Source code repository: `weblate://mod-name/mod-name`
- On next page, select `Json nested structure file` with path pattern:
- File mask: `Mods/XXX/Content/translation/*.json` for submods.
- File mask: `Mods/XXX/Mods/YYY/Content/translation/*.json` for submods of submods
- Json indentation: `1`
- Json indentation style: `Tabs`
- Monolingual base language file: `Mods/XXX/Content/translation/english.json` for submods, or `Mods/XXX/Mods/YYY/Content/translation/english.json` for submods of submods.
- Edit base file: `off`
- Adding new translation: `Disable adding new translations`
[![In the Wake of Gods translation status](https://weblate.vcmi.eu/widget/wake-of-gods/multi-auto.svg)](https://weblate.vcmi.eu/engage/wake-of-gods/)
WARNING: Do not edit or move translation files other than through Weblate. If you have to, for example due to submod reorganization, please contact VCMI Team.
### Tides of War
## Translating mods manually
### Exporting translation
If you want to start new translation for a mod or to update existing one you may need to export it first. To do that:
- Optionally, backup your mod preset - game may modify active submods of mod being translated
- Set game language in Launcher to one that you want to target
- launch VCMI server in translation export mode:
- (Windows) Create shortcut for VCMI_Server.exe and append `--translate-mod=XXX` to "Target" field in shortcut properties, where XXX is identifier of mod that you want to translate
- (command-line) Open command line and run `vcmiserver --translate-mod=XXX`, where XXX is identifier of mod that you want to translate
After that, start Launcher, switch to Help tab and open "log files directory". You can find exported json's in `extracted/translation` directory.
### Exporting translation (alternative)
Alternatively, you can use vcmi client to do similar actions:
- Enable mod(s) that you want to export and set game language in Launcher to one that you want to target
- Launch VCMI and start any map to get in game
- Press Tab to activate chat and enter '/translate'
After that, start Launcher, switch to Help tab and open "log files directory". You can find exported json's in `extracted/translation` directory.
If your mod also contains maps or campaigns that you want to translate, then use `/translate maps` command instead.
If you want to update existing translation, you can use `/translate missing` command that will export only strings that were not translated
NOTE: when translating with this method, some strings may not export correctly, for example strings that were modified in multiple mods. To avoid this, you'll need to disable mods that overrride other strings and do a second re-run of this command
### Translating mod information
In order to display information in Launcher in language selected by user add following block into your `mod.json`:
```json
"<language>" : {
"name" : "<translated name>",
"description" : "<translated description>",
"author" : "<translated author>",
"translations" : [
"translation/<language>.json"
]
},
```
However, normally you don't need to use block for English. Instead, English text should remain in root section of your `mod.json` file, to be used when game can not find translated version.
### Translating in-game strings
After you have exported translation and added mod information for your language, copy exported file to `<mod directory>/Content/translation/<language>.json`.
Use any text editor (Notepad++ is recommended for Windows) and translate all strings from this file to your language
## Developers documentation
### Adding new languages
In order to add new language it needs to be added in multiple locations in source code:
- Generate new .ts files for launcher and map editor, either by running `lupdate` with name of new `.ts` or by copying `english.ts` and editing language tag in the header.
- Add new language into `lib/Languages.h` entry. This will trigger static_assert's in places that needs an update in code
- Add new language into json schemas validation list - settings schema and mod schema
- Add new language into mod json format - in order to allow translation into new language
Also, make full search for a name of an existing language to ensure that there are not other places not referenced here
### Updating translation of Launcher and Map Editor to include new strings
At the moment, build system will generate binary translation files (`.qs`) that can be opened by Qt.
However, any new or changed lines will not be added into existing .ts files.
In order to update `.ts` files manually, open command line shell in `mapeditor` or `launcher` source directories and execute command
```sh
lupdate -no-obsolete * -ts translation/*.ts
```
This will remove any no longer existing lines from translation and add any new lines for all translations. If you want to keep old lines, remove `-no-obsolete` key from the command.
There *may* be a way to do the same via QtCreator UI or via CMake, if you find one feel free to update this information.
### Updating translation of Launcher and Map Editor using new .ts file from translators
Generally, this should be as simple as overwriting old files. Things that may be necessary if translation update is not visible in executable:
- Rebuild subproject (map editor/launcher).
- Regenerate translations via `lupdate -no-obsolete * -ts translation/*.ts`
### Translating the Installer
VCMI uses an Inno Setup installer that supports multiple languages. To add a new translation to the installer, follow these steps:
1. **Download the ISL file for your language:**
- Visit the Inno Setup repository to find the language file you need:
[Inno Setup Languages](https://github.com/jrsoftware/issrc/tree/main/Files/Languages).
2. **Add custom VCMI messages:**
- Open the downloaded ISL file and include the necessary VCMI-specific custom messages.
- Refer to the `English.isl` file in the repository for examples of required custom messages.
- Ensure that all messages, such as `WindowsVersionNotSupported` and `ConfirmUninstall`, are correctly translated and match the functionality described in the English version.
3. **Modify the `ConfirmUninstall` message:**
- The VCMI installer uses a custom Uninstall Wizard. Ensure the `ConfirmUninstall` message is consistent with the English version and accurately reflects the intended functionality.
4. **Modify the `WindowsVersionNotSupported` message:**
- Translate and update this message to ensure it aligns with the intended warning in the English version.
5. **Add the new language to the installer script:**
- Edit the `[Languages]` section of the Inno Setup script.
- Add an entry for your language, specifying the corresponding ISL file.
Example syntax for adding a language:
```text
[Languages]
Name: "english"; MessagesFile: "{#LangPath}\English.isl"
Name: "czech"; MessagesFile: "{#LangPath}\Czech.isl"
Name: "<your-language>"; MessagesFile: "{#LangPath}\<your-language>.isl"
```
[![Tides of War translation status](https://weblate.vcmi.eu/widget/horn-of-the-abyss/multi-auto.svg)](https://weblate.vcmi.eu/engage/tides-of-war/)