chore: update the i18n README and extract script

- drop obsolete translations
- remove references to source code lines from the TS files

Fixes #18294
This commit is contained in:
Lukáš Tinkl
2025-07-08 19:45:11 +02:00
committed by Lukáš Tinkl
parent 49751f1cee
commit f9fa27fb8f
27 changed files with 2625 additions and 465458 deletions
+14 -9
View File
@@ -1,22 +1,27 @@
# Internationalization
# Internationalization (i18n)
App is translated to many different languages through lokalise.com platform.
App is translated to many different languages through lokalise.com platform. For this purpose, we are using Qt's [TS file format](https://doc.qt.io/qt-6/linguist-ts-file-format.html).
There are excellent manuals detailing the translation process for [developers](https://doc.qt.io/qt-6/linguist-programmers.html), [release managers](https://doc.qt.io/qt-6/linguist-manager.html) and [translators](https://doc.qt.io/qt-6/linguist-translators.html) in the Linguist manual (Qt's translation tool).
## TLDR
## Developer workflow
### Update base translations file
1. Update qml_en.ts file: `cd scripts/translationScripts && python update-en-ts.py`
2. Ensure updated qml_en.ts file lands on master
1. Update the base TS files (`qml_base.ts` and `qml_en.ts`, the latter serving only for the purpose of providing plural forms for English):
```bash
$ cd scripts/translationScripts
$ python update-en-ts.py
```
2. The updated TS files are created in the `ui/i18n/` directory
3. Ensure the updated base files land in master
### Update translations
1. Create pull request with exported translations using lokalise.com, see [docs](https://docs.lokalise.com/en/articles/1684090-github)
## Lokalise workflow
## Translator workflow
Lokalise is a continuous localization and translation management platform. It integrates into development workflow and automates localization process.
Lokalise workflow:
1. Upload english strings (qml_en.ts) to Lokalise project. This is done automatically, Lokalise auto-pull changes done to master's qml_en.ts file
1. Upload base strings (`qml_base.ts` and `qml_en.ts` files) to Lokalise project. This is done automatically, Lokalise auto-pulls changes done to master's TS files.
2. Translate strings to target languages. Target languages are driven by Lokalise configuration. Translations are done by community
3. Export *.ts files with translations (e.g. qml_de.ts, qml_en.ts)
3. Export *.ts files with translations (e.g. qml_de.ts, qml_fr.ts)
4. Create pull request with exported translations
+2 -3
View File
@@ -2,7 +2,6 @@
import xml.etree.ElementTree as ET
import subprocess
import os
# 1) Runs lupdate on ../../ui/nim-status-client.pro
# 2) Fixups qml_base.ts: ensure each source has translation, otherwise Lokalise can't figure out base words
@@ -28,13 +27,13 @@ def fixupTranslations(enTsFile: str):
if __name__ == "__main__":
# full base TS file (has to come first as we're targetting the same language)
basefile = "../../ui/i18n/qml_base.ts"
p = subprocess.run(['lupdate', '../../ui/nim-status-client.pro', '-source-language', 'en', '-no-obsolete', '-target-language', 'en_GB', '-ts', basefile],
p = subprocess.run(['lupdate', '../../ui/nim-status-client.pro', '-locations', 'none', '-source-language', 'en', '-no-obsolete', '-ts', basefile],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True, text=True)
print(p.stdout)
fixupTranslations(basefile)
# EN "translation" file, plurals only
enfile = "../../ui/i18n/qml_en.ts"
p = subprocess.run(['lupdate', '../../ui/nim-status-client.pro', '-source-language', 'en', '-pluralonly', '-target-language', 'en_GB', '-ts', enfile],
p = subprocess.run(['lupdate', '../../ui/nim-status-client.pro', '-locations', 'none', '-source-language', 'en', '-pluralonly', '-no-obsolete', '-target-language', 'en_GB', '-ts', enfile],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True, text=True)
print(p.stdout)
-19781
View File
File diff suppressed because it is too large Load Diff
+2369 -11401
View File
File diff suppressed because it is too large Load Diff
-19692
View File
File diff suppressed because it is too large Load Diff
-19693
View File
File diff suppressed because it is too large Load Diff
-19705
View File
File diff suppressed because it is too large Load Diff
+240 -715
View File
File diff suppressed because it is too large Load Diff
-19705
View File
File diff suppressed because it is too large Load Diff
-19706
View File
File diff suppressed because it is too large Load Diff
-19705
View File
File diff suppressed because it is too large Load Diff
-19703
View File
File diff suppressed because it is too large Load Diff
-19733
View File
File diff suppressed because it is too large Load Diff
-19688
View File
File diff suppressed because it is too large Load Diff
-19700
View File
File diff suppressed because it is too large Load Diff
-19676
View File
File diff suppressed because it is too large Load Diff
-19675
View File
File diff suppressed because it is too large Load Diff
-19689
View File
File diff suppressed because it is too large Load Diff
-19701
View File
File diff suppressed because it is too large Load Diff
-19738
View File
File diff suppressed because it is too large Load Diff
-19704
View File
File diff suppressed because it is too large Load Diff
-19716
View File
File diff suppressed because it is too large Load Diff
-19797
View File
File diff suppressed because it is too large Load Diff
-19777
View File
File diff suppressed because it is too large Load Diff
-19692
View File
File diff suppressed because it is too large Load Diff
-19678
View File
File diff suppressed because it is too large Load Diff
-19676
View File
File diff suppressed because it is too large Load Diff