Add translations documentation

Pavel Baksy 2026-01-13 17:35:11 +01:00
parent 790c02ce63
commit 1f404d433f

87
Translation.md Normal file

@ -0,0 +1,87 @@
# Translation Guide
Roster uses standard GNOME gettext infrastructure for internationalization (i18n).
## Quick Start for Translators
### 1. Generate the Translation Template
From the project root, after setting up the build:
```bash
meson setup builddir
ninja -C builddir roster-pot
```
This creates `po/roster.pot` with all translatable strings.
### 2. Create Your Language Translation
```bash
cd po
msginit -l LANG_CODE -o LANG_CODE.po -i roster.pot
```
Replace `LANG_CODE` with your language code (e.g., `cs_CZ` for Czech, `de` for German, `fr` for French).
### 3. Translate the Strings
Edit the `.po` file with a translation editor:
- **GNOME Translation Editor** (gtranslator) - recommended
- **Poedit**
- **Lokalize** (KDE)
- Any text editor
### 4. Register Your Translation
Add your language code to `po/LINGUAS` (keep alphabetically sorted):
```
cs_CZ
de
fr
```
### 5. Test Your Translation
```bash
ninja -C builddir
ninja -C builddir install
LANG=your_LANG_CODE.UTF-8 roster
```
## What Gets Translated
The translation system covers:
- Application UI (window.ui, dialogs)
- Menu items and labels
- Desktop file (application name, description, keywords)
- AppStream metadata (for software centers)
- GSettings schema (settings descriptions)
- Python source strings (error messages, notifications)
## Updating Translations
When the application changes:
```bash
ninja -C builddir roster-update-po
```
This updates all `.po` files with new/changed strings.
## Language Codes
Use standard locale codes:
- Two-letter: `de`, `fr`, `es`, `it`
- With country: `pt_BR`, `zh_CN`, `en_GB`
## Contributing
Submit translations via:
1. Pull request to the repository
2. Issue on GitHub/GitLab with attached `.po` file
3. Email to maintainer
See [Contributing](Contributing.md) for more details.