Bug 38155 - Univention Management Console translations not working as described
Univention Management Console translations not working as described
Status: CLOSED FIXED
Product: UCS extended documentation
Classification: Unclassified
Component: Developer documentation
unspecified
Other Linux
: P5 normal (vote)
: UCS 4.1-0-errata
Assigned To: Florian Best
Daniel Tröder
:
Depends on:
Blocks: 40339 40340 40341
  Show dependency treegraph
 
Reported: 2015-03-30 10:21 CEST by Stephan Luft
Modified: 2016-02-02 14:36 CET (History)
5 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Luft univentionstaff 2015-03-30 10:21:19 CEST
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
Comment 1 Florian Best univentionstaff 2015-04-08 14:53:52 CEST
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'
Comment 2 Daniel Orrego univentionstaff 2015-12-23 17:28:36 CET
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.
Comment 3 Daniel Orrego univentionstaff 2015-12-24 11:10:56 CET
(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.
Comment 4 Florian Best univentionstaff 2016-01-08 16:09:57 CET
Fixed the docs.

r66675 | Bug #38155: fix filename of executable
Comment 5 Daniel Tröder univentionstaff 2016-01-29 13:35:03 CET
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)
Comment 6 Philipp Hahn univentionstaff 2016-02-02 14:36:20 CET
r67130 | Bug #38829,Bug #40447 doc: PUBLISH
r66829 | Bug #40085,Bug #40080,Bug #39018,Bug #39017,Bug #40382: doc