Update translation workflow document

This commit is contained in:
Wuzzy 2024-11-26 14:42:57 +01:00
parent 1e3f9cbeb3
commit 07806f950d

View File

@ -8,14 +8,9 @@ This document is directed to *developers* describing what to do how to make sure
## Introduction
Repixture translations utilize Weblate to allow translators to translate the game online. But for this to work, the workflow to maintain translations is a little bit more involved.
Repixture translations utilize Weblate to allow translators to translate the game online.
Rather than translating strings directly in the TR files, translators are encouraged to go to <https://translate.codeberg.org/projects/repixture/> to translate the string. The Repixture maintainer(s) do the rest.
* **TR files** (`*.tr`) contain the translation that Repixture actually uses in the game. They can be found in the `locale` subdirectories of the mods
* **PO files** (`*.po`) are automatically generated and are required for Weblate to work. Repixture ignores them. They can be found in the `poconvert` subdirectory of those `locale` directories
**IMPORTANT**: Translators should NOT translate the TR or PO files in this game repository, as it disrupts the workflow. They are adviced to go to the aforementioned website instead.
Rather than translating strings directly in the PO files, translators are encouraged to go to <https://translate.codeberg.org/projects/repixture/> to translate the string. The Repixture maintainer(s) do the rest.
## Preconditions
@ -23,17 +18,14 @@ Rather than translating strings directly in the TR files, translators are encour
You need:
* Python 3
* The script `mod_translation_updater.py` (from <https://github.com/minetest/modtools>)
* The script `mtt_convert.py` (from <https://codeberg.org/Wuzzy/Minetest_Translation_Tools>)
* The script `mtt_check.py` (from <https://codeberg.org/Wuzzy/Minetest_Translation_Tools>)
* gettext
## Part 1: Pushing the translations from the game to Weblate:
1. Clean up: Make sure the game repository is in a clean state (no non-committed changes)
2. Update TR files: Run `mod_translation_updater.py` in the `mods` directory and commit the changes (if any)
3. Convert TR to PO: Run `mtt_convert.py --tr2po -r` in the `mods` directory and commit the changes
2. Update POT files: Run `update_locale_templates.py` in the root directory of this repositoryand commit the changes (if any)
3. Update PO files: TODO
4. Push: Push the changes to the online repository of the game
5. Update Weblate repository (optional): Weblate should soon automatically update its repository. But if you want to want the new strings to be available immediately, go to the project page, then “Manage > Repository Maintenance” and click “Update”
@ -54,20 +46,5 @@ This part is usually done when youre preparing a release. You want to extract
1. Clean up: Make sure the game repository is in a clean state (no non-committed changes)
2. Commit to Weblate repository: Go to “Manage > Repository Maintenance” and click “Commit” (if the number of pending commits is 0, you can skip this step)
3. Pull from Weblate repository: `git pull weblate <name of main branch>`
4. Convert PO to TR: Run `mtt_convert.py --po2tr -r` in the `mods` directory and commit the changes
Now all the translations from Weblate should be in the game. You may want to do a quick in-game test to make sure.
## Checking translations
At least once directly before a release, you should check the TR files for syntax errors.
1. Run `mtt_check.py -r` in the `mods` directory of the game
2. For all string errors in languages you speak, fix the offending strings **in Weblate**
3. For all string errors in languages you do not speak, **blank out** the offending strings **in Weblate**
4. For errors that are unrelated to a string, fix the TR file directly (note: if these errors keep happening, this could be a sign of an underlying flaw somewhere. Investigate!)
5. Try to fix all warnings as well unless its unreasonable to do so
Checking for syntax errors regularly is important. One of the most common technical mistakes of translators is to forget a placeholder (`@1`, `@2`, etc.) in the translation which is problematic because it leads to a loss of information to the player.