Univention Bugzilla – Bug 38155
Univention Management Console translations not working as described
Last modified: 2016-02-02 14:36:20 CET
In our dev reference for adding own translations (http://docs.univention.de/developer-reference-4.0.html#chap:translation) there is described how to add a new translation package. 'univention-ucs-translation-build-package' does not exist, instead there is a 'univention-ucs-translation-build-package.py'. If the py is used instead it terminates with an traceback root@ucs:~/translation# univention-ucs-translation-build-package \ -s ~/translation/ucs-4.0-0/ -s it -l it_IT.UTF-8:UTF-8 -n Italian bash: univention-ucs-translation-build-package: Kommando nicht gefunden. root@ucs:~/translation# univention-ucs-translation-build-package.py \ -s ~/translation/ucs-4.0-0/ -s it -l it_IT.UTF-8:UTF-8 -n Italian Traceback (most recent call last): File "/usr/bin/univention-ucs-translation-build-package.py", line 38, in <module> import univention.translationhelper as tlh ImportError: No module named translationhelper root@ucs:~/translation# Mentioned in Ticket#2015031221000342
This is due to a missing package migration to UCS 4.0 (Bug #36115). The following patch fixes this partly: diff --git a/ucs-4.0-1/packaging/univention-ucs-translation-template/debian/rules b/ucs-4.0-1/packaging/univention-ucs-translation-template/debian/rules index d462933..f377382 100755 --- a/ucs-4.0-1/packaging/univention-ucs-translation-template/debian/rules +++ b/ucs-4.0-1/packaging/univention-ucs-translation-template/debian/rules @@ -32,4 +32,4 @@ override_dh_auto_test: dh_auto_test %: - dh $@ + dh $@ --with python_support But after that the script is broken / will not work with UCS 4.0-0 source code: update_package_translation_files module: {'Icons': 'umc/icons', 'Definition': 'umc/uvmm.xml', 'package': 'univention-management-console-module-uvmm', 'Python': 'umc/python', 'core': False, 'Javascript': 'umc/js', 'Module': 'uvmm'} msgfmt: it/./virtualization/univention-virtual-machine-manager-daemon/umc/python/uvmm/it.po: Warnung: Kopfteil der PO-Datei ist ungenau (fuzzy) Warnung: ältere Versionen von »msgfmt« werden hierbei einen Fehler melden it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:21: Mehrfachdefinition der Meldung... it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:16: ...dies ist die Stelle der ersten Definition it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:24: Mehrfachdefinition der Meldung... it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:19: ...dies ist die Stelle der ersten Definition msgfmt: es sind 2 fatale Fehler aufgetreten install: Aufruf von stat für „it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.mo“ nicht möglich: Datei oder Verzeichnis nicht gefunden Traceback (most recent call last): File "/usr/bin/univention-ucs-translation-build-package.py", line 77, in <module> tlh.update_and_install_translation_files_to_correct_path(module, options.target_language, package_path_absolute, startdir) File "/usr/lib/pymodules/python2.7/univention/translationhelper.py", line 111, in update_and_install_translation_files_to_correct_path os.unlink(os.path.join(package_path_absolute, po_file.replace('.po', '.mo'))) OSError: [Errno 2] No such file or directory: 'it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.mo'
This has not been fixed as for UCS4.1 Actually there are multiple problems reported in Comment 1 (After the patch). I will open different bugs for them to leave this bug to the first problem on the description.
(In reply to Florian Best from comment #1) > This is due to a missing package migration to UCS 4.0 (Bug #36115). > The following patch fixes this partly: > [...] > Warnung: ältere Versionen von »msgfmt« werden hierbei einen Fehler melden > it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:21: > Mehrfachdefinition der Meldung... > it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:16: > ...dies ist die Stelle der ersten Definition > it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:24: > Mehrfachdefinition der Meldung... > it/./virtualization/univention-virtual-machine-manager-daemon/umc/it.po:19: > ...dies ist die Stelle der ersten Definition > msgfmt: es sind 2 fatale Fehler aufgetreten > [...] A quick manual fix for both problems (at runtime) is to: * Add the links to the module: ln -s /usr/share/pyshared/univention/translationhelper.py /usr/lib/pymodules/python2.7/univention/ ln -s /usr/share/pyshared/univention/translationhelper.py /usr/lib/pymodules/python2.6/univention/ * and to delete the repeated msgs on th po file vi virtualization/univention-virtual-machine-manager-daemon/umc/it.po After that, running univention-ucs-translation-build-package again will create the package.
Fixed the docs. r66675 | Bug #38155: fix filename of executable
OK: Developer Reference contains now the correct executable name (see http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-0/job/Handbook%20Developer/lastBuild/artifact/webroot/developer-reference-4.1.html)
r67130 | Bug #38829,Bug #40447 doc: PUBLISH r66829 | Bug #40085,Bug #40080,Bug #39018,Bug #39017,Bug #40382: doc