Skip to content

Commit

Permalink
Add contributing guidance for the new translations files
Browse files Browse the repository at this point in the history
If we do adopt this approach, we should probably have a generic "how to use Weblate" guide somewhere (in the loot.github.io repository?).
  • Loading branch information
Ortham committed May 19, 2024
1 parent 761b6dd commit ee5854c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,33 @@ 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 integrating 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 manually by a maintainer. When adding a new message to the prelude, it's enough to add its anchor and English message to `translations/messages.en.yaml`: Weblate will then show it as a missing translation for all other languages.

**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 |
| `uk_UA` | Ukrainian |
| `zh_CN` | Chinese (Simplified) |

0 comments on commit ee5854c

Please sign in to comment.