Add contributing guidance for the new translations files

If we do adopt this approach, we should probably have a generic "how to use Weblate" guide somewhere (in the loot.github.io repository?).
This commit is contained in:
Oliver Hamlet
2024-07-03 19:54:10 +01:00
parent cf7de41671
commit 905a030557
+31
View File
@@ -20,3 +20,34 @@ If you send a pull request, then discover that you have made a mistake, feel fre
Pull requests and all commits to the prelude repository are automatically run through a validator to check for syntax errors.
Nevertheless, it is advisable to test your changes on your own LOOT install before sending a pull request, as they may have valid syntax but not have the intended effect. Instructions on how to do so can be found on [LOOT's wiki](https://loot.github.io/docs/contributing/Quickly-Testing-Your-Masterlist-Changes).
### Translations
`prelude.yaml` contains localised messages that are used by LOOT, and the data structure used to localise messages in LOOT's metadata files (including the prelude) is described [here](https://loot-api.readthedocs.io/en/stable/metadata/data_structures/localised_content.html). The localized content data structures should be sorted alphabetically by locale code with the exception of `en` at the beginning since it is LOOT's default language.
The `translations` directory is used to integrate with [Weblate](https://hosted.weblate.org/projects/loot/prelude/) so that translations can be managed and maintained there. The `translations` directory contains `messages.<locale code>.yaml` files, where `<locale code>` is a POSIX locale code (see the table below for examples). Each file contains a map where the keys are anchor names and the values are the localised text for that language.
The anchor names correspond to the YAML anchors used for localised messages in `prelude.yaml`, but the contents of the `translations` directory are **not** automatically synchronised with `prelude.yaml`: that must be done by a maintainer. There are scripts available to help synchronise translations, see [README.md](./README.md#synchronising-weblate-translations) for details.
**Note:** If adding a translation for a new language, you need to add support for it to LOOT before it will be usable: see [LOOT's contributing guide](https://github.com/loot/loot/blob/master/CONTRIBUTING.md#translating-loot) for more information.
| Locale Code | Language |
| ------------- | ----------- |
| `bg` | Bulgarian |
| `cs` | Czech |
| `da` | Danish |
| `de` | German |
| `es` | Spanish |
| `fi` | Finnish |
| `fr` | French |
| `it` | Italian |
| `ja` | Japanese |
| `ko` | Korean |
| `pl` | Polish |
| `pt_BR` | Portuguese (Brazil) |
| `pt_PT` | Portuguese |
| `ru` | Russian |
| `sv` | Swedish |
| `tr_TR` | Turkish |
| `uk_UA` | Ukrainian |
| `zh_CN` | Chinese (Simplified) |