Univention Bugzilla – Bug 42293
Use xgettext with --language JavaScript instead of python
Last modified: 2017-04-04 18:28:52 CEST
... this would allow us to use features such as plural forms (Bug 42220) and extracted comments [1] in order to give hints to the translator (Bug 41221). ---------- 8< --------- cat > test.js <<EOM // t10n: test console.log(_('Translate me!')); EOM xgettext --force-po --from-code=UTF-8 --sort-output --package-name=test \ --language JavaScript --add-comments=t10n -o test.po test.js tail -n 4 test.po #. t10n: test #: test.js:2 msgid "Translate me!" msgstr "" ---------- 8< --------- [1] https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files
Currently management/u-m-c/dev/dh_umc.py calls xgettext with python as language for JS files.
(In reply to Alexander Kläser from comment #1) > Currently management/u-m-c/dev/dh_umc.py calls xgettext with python as > language for JS files. Yes, because the current xgettext version in UCS 4.1 doesn't know JavaScript yet. In UCS 4.2 xgettext knows JavaScript.
Javascript files are now translated/treated as Javascript language by xgettext. Also --add-comments=i18n has been added. univention-management-console (9.0.6-1): r72305 | Bug #42293: use JavaScript as translation language for .js files
AFAIS, univention-ucs-translation-template needs also to be adapted.
univention-ucs-translation-template (4.0.1-1): r72345 | Bug #42293: use JavaScript as translation language for .js files
I just checked it with the plural form, for this
(In reply to Alexander Kläser from comment #6) > I just checked it with the plural form, for this Wrong bug, See Bug #42220
AFAIS, everything works fine. I tested the basic functioning via building modules, the code is now less error prone and works also for modules without JS or Python code (e.g., univention-saml). I spotted a problem with the translation tests for which I opened Bug 43454. VERIFIED for now.
UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug".