See discussion #4641 for premise, reasoning, arguments and conclusions.
- [x]… Plan out Migration
- [x] Set up Weblate Project
- [x] Change test project from _(my)_ fork to our repo
- [x] Set project up again (after it was removed despite being requested for libre hosting)
- [x] Component/ts file configuration
- [x] GitHub integration
- [x] Squash addon (by author)
- [x] Request libre hosting on Hosted Weblate
- [x] Wait for libre hosting to be approved
- [x] Ensure completeness
- [x] Verify all languages are present in Weblate
- [x] Make sure all translations in Transifex are present in the files
- [x] Make sure bot min percentage is 0
- [x] Make sure to run bot
- [x] Fix our TransifexBot service
- [x] ~Fix Chinese language mapping~
- [x] Prepare clean transition
- [x] Check for scripts and build inclusion of ts and qm files _(CMake logic calls lupdate and lrelease)_
- [x] Check on whether we can separate format changes to translation changes #4811
- [x] Drop Transifex workaround from `updatetranslations.sh`(?) (`numerusform`) #4811
- [x] Translation fixup to reduce diff PR #4829
- [x] Transition
- [x] Complete last Transifex PRs
- [x] Disable Transifex (archive it in org settings)
- [x] Archive [MumbleTransifexBot repository](https://github.com/mumble-voip/MumbleTransifexBot)
- [x] Merge previous translations
- [x] “Mention you use Weblate for translations in the README.” _(requirement for libre hosting)_
- [x] Add requested Sinhala (si) language
- [x] Update documentation
- [x] Post announcement (~translation email list~, ~Transifex announcement~, website news post)
- [x] [mumble-www #158](https://github.com/mumble-voip/mumble-www/pull/158)
- [x] ~Inform and invite previous translators~
- [ ] Misc
- [x] ~Make builds not change ts files~
- [x] ~Implement PR code check to indicate outdated translations~ already exists
- [ ] Automatically update translation texts?
- [ ] Can MR title be in custom format? `TRANSLATION: Update translations from Weblate
- [ ] Weblate does not apply the lupdate heuristics. Can it? Otherwise, PR Translations build fails as outdated. How to handle?
---
We have `scripts/transtate.py` which expects qm files to not exist and parses the log output of generating them into a translation progress/percentage ordered list.
We have `scripts/updatetranslations.sh` which updates `mumble_en.ts` from source (`lupdate`, `numerus` fix, commit).
---
The numerus fix is for Transifex specifically (see #1195), and the referenced Transifex forum post no longer exists (dead link, dead forums).
No docs to be found about `<numerusform>` except in the official DTD, but with a note that the DTD should allow multiple but can’t.
Seems to be for strings with a numeric parameter, and being able to specify different strings for a 1 vs >1 value.
https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals (no mention of `numerus`.)
---
In `updatetranslations.sh` we call `lupdate -no-ui-lines -disable-heuristic similartext -locations none -no-obsolete -no-recursive -extensions "ui,c,cpp,h,mm" "./src" "./src/mumble" -ts "$filePath"`.
`src/mumble/CMakeLists.txt` line 698 condition `if (translations)` (option), sets `ts_files`, and uses them in line 741 for calling `create_translations_qrc(${CMAKE_CURRENT_SOURCE_DIR} "${ts_files}" "translations.qrc")`.
`cmake/qt-utils.cmake` defines `function(create_translations_qrc TS_DIR TS_FILES QRC_FILENAME)`, which calls `qt5_create_translation(QM_FILES ${TS_DIR} ${TS_FILES})` (_it calls find_pkg for `LinguistTools` but I did not find where that is…_). See [qt5_create_translation docs](https://doc.qt.io/qt-5/qtlinguist-cmake-qt5-create-translation.html) (_that page is missing nav context_). `qt5_create_translation(<VAR> ts-file-or-sources [ts-file-or-sources2 ...] [OPTIONS ...])`
A build (the cmake definitions mentioned above are used) leads to changes in the ts files.
It seems like using the same parameters as we use in the `updatetranslations.sh` script would make more sense both for consistency as well as not dirtying the working copy/file tree with changes (build side effect).
lupdate.exe -help
```
Usage:
lupdate [options] [project-file]...
lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file
lupdate is part of Qt's Linguist tool chain. It extracts translatable
messages from Qt UI files, C++, Java and JavaScript/QtScript source code.
Extracted messages are stored in textual translation source files (typically
Qt TS XML). New and modified messages can be merged into existing TS files.
Passing .pro files to lupdate is deprecated.
Please use the lupdate-pro tool instead.
Options:
-help Display this information and exit.
-no-obsolete
Drop all obsolete and vanished strings.
-extensions <ext>[,<ext>]...
Process files with the given extensions only.
The extension list must be separated with commas, not with whitespace.
Default: 'java,jui,ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx,js,qs,qml,qrc'.
-pluralonly
Only include plural form messages.
-silent
Do not explain what is being done.
-no-sort
Do not sort contexts in TS files.
-no-recursive
Do not recursively scan directories.
-recursive
Recursively scan directories (default).
-I <includepath> or -I<includepath>
Additional location to look for include files.
May be specified multiple times.
-locations {absolute|relative|none}
Specify/override how source code references are saved in TS files.
Guessed from existing TS files if not specified.
Default is absolute for new files.
-no-ui-lines
Do not record line numbers in references to UI files.
-disable-heuristic {sametext|similartext|number}
Disable the named merge heuristic. Can be specified multiple times.
-project <filename>
Name of a file containing the project's description in JSON format.
Such a file may be generated from a .pro file using the lprodump tool.
-pro <filename>
Name of a .pro file. Useful for files with .pro file syntax but
different file suffix. Projects are recursed into and merged.
This option is deprecated. Use the lupdate-pro tool instead.
-pro-out <directory>
Virtual output directory for processing subsequent .pro files.
-pro-debug
Trace processing .pro files. Specify twice for more verbosity.
-source-language <language>[_<region>]
Specify the language of the source strings for new files.
Defaults to POSIX if not specified.
-target-language <language>[_<region>]
Specify the language of the translations for new files.
Guessed from the file name if not specified.
-tr-function-alias <function>{+=,=}<alias>[,<function>{+=,=}<alias>]...
With +=, recognize <alias> as an alternative spelling of <function>.
With =, recognize <alias> as the only spelling of <function>.
Available <function>s (with their currently defined aliases) are:
Q_DECLARE_TR_FUNCTIONS (=Q_DECLARE_TR_FUNCTIONS)
QT_TR_N_NOOP (=QT_TR_N_NOOP)
QT_TRID_N_NOOP (=QT_TRID_N_NOOP)
QT_TRANSLATE_N_NOOP (=QT_TRANSLATE_N_NOOP)
QT_TRANSLATE_N_NOOP3 (=QT_TRANSLATE_N_NOOP3)
QT_TR_NOOP (=QT_TR_NOOP)
QT_TRID_NOOP (=QT_TRID_NOOP)
QT_TRANSLATE_NOOP (=QT_TRANSLATE_NOOP)
QT_TRANSLATE_NOOP3 (=QT_TRANSLATE_NOOP3)
QT_TR_NOOP_UTF8 (=QT_TR_NOOP_UTF8)
QT_TRANSLATE_NOOP_UTF8 (=QT_TRANSLATE_NOOP_UTF8)
QT_TRANSLATE_NOOP3_UTF8 (=QT_TRANSLATE_NOOP3_UTF8)
findMessage (=findMessage)
qtTrId (=qtTrId)
tr (=tr)
trUtf8 (=trUtf8)
translate (=translate)
qsTr (=qsTr)
qsTrId (=qsTrId)
qsTranslate (=qsTranslate)
-ts <ts-file>...
Specify the output file(s). This will override the TRANSLATIONS.
-version
Display the version of lupdate and exit.
@lst-file
Read additional file names (one per line) or includepaths (one per
line, and prefixed with -I) from lst-file.
```
Used options in `updatetranslations.sh`:
| `lupdate` Option | Description |
|---|---|
| `-no-ui-lines` | Do not record line numbers in references to UI files. |
| `-disable-heuristic similartext` | `{sametext\|similartext\|number}` Disable the named merge heuristic. Can be specified multiple times. |
| `-locations none` | `{absolute\|relative\|none}` Source code references in TS files. Guessed from existing TS files if not specified. Default is absolute for new files. |
| `-no-obsolete` | Drop all obsolete and vanished strings. |
| `-no-recursive` | Do not recursively scan directories. |
| `-extensions "ui,c,cpp,h,mm"` | `<ext>[,<ext>]...` Process files with the given extensions only. Default: 'java,jui,ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx,js,qs,qml,qrc'. |
| `"./src" "./src/mumble"` | `[source-file\|path\|@lst-file]...` _source_ |
| `-ts "$filePath"` | `-ts ts-files\|@lst-file` _target_ |