|
|
||
|---|---|---|
| .. | ||
| ReadMe.md | ||
| ar.po | ||
| es.po | ||
| fr.po | ||
| nl.po | ||
| pt_BR.po | ||
| template.pot | ||
ReadMe.md
Translate
Status
| Locale | Lines | % Done |
|---|---|---|
| Template | 36 | |
| ar | 5/36 | 13% |
| es | 23/36 | 63% |
| fr | 5/36 | 13% |
| nl | 23/36 | 63% |
| pt_BR | 19/36 | 52% |
New Translations
- Fill out
template.potwith your translations then open a new issue, name the filespanish.txt, attach the txt file to the issue (drag and drop).
Or if you know how to make a pull request
- Copy the
template.potfile and name it your locale's code (Eg:en/de/fr) with the extension.po. Then fill out all themsgstr "". - Your region's locale code can be found at: https://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes/28357857#28357857
Scripts
Zren's kpac script can easily run the gettext commands for you, parsing the metadata.json and filling out any placeholders for you. kpac can be downloaded here and should be placed at ~/Code/plasmoid-widgetname/kpac to edit translations at ~/Code/plasmoid-widgetname/package/translate/.
python3 ./kpac i18nwill parse thei18n()calls in the*.qmlfiles and write it to thetemplate.potfile. Then it will merge any changes into the*.polanguage files. Then it converts the*.pofiles to it's binary*.moversion and move it tocontents/locale/...which will bundle the translations in the*.plasmoidwithout needing the user to manually install them.python3 ./kpac localetestwill convert the.poto the*.mofiles then runplasmoidviewer(part ofplasma-sdk).
How it works
Since KDE Frameworks v5.37, translations can be bundled with the zipped *.plasmoid file downloaded from the store.
xgettextextracts the messages from the source code into atemplate.pot.- Translators copy the
template.pottofr.poto translate the French language. - When the source code is updated, we use
msgmergeto update thefr.pobased on the updatedtemplate.pot. - When testing or releasing the widget, we convert the
.pofiles to their binary.moform withmsgfmt.
The binary .mo translation files are placed in package/contents/locale/ so you may want to add *.mo to your .gitignore.
package/contents/locale/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo
Links
- https://develop.kde.org/docs/plasma/widget/translations-i18n/
- https://l10n.kde.org/stats/gui/trunk-kf5/team/fr/plasma-desktop/
- https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems
- https://api.kde.org/frameworks/ki18n/html/prg_guide.html
Version 8 of Zren's i18n scripts.