Bug 41187 - translate SAML identity provider module description
translate SAML identity provider module description
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: SAML
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-3-errata
Assigned To: Eduard Mai
Alexander Kläser
:
Depends on:
Blocks: 43349
  Show dependency treegraph
 
Reported: 2016-05-03 10:10 CEST by Florian Best
Modified: 2017-01-17 10:35 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.011
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:
mai: Patch_Available+


Attachments
pseudo patch (1.89 KB, patch)
2016-07-20 14:04 CEST, Florian Best
Details | Diff
workaround without changes in dh-umc* (4.34 KB, patch)
2016-07-21 12:48 CEST, Eduard Mai
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-05-03 10:10:49 CEST
The SAML identity provider module in the UMC overview is not translated. (title + description).
Comment 1 Alexander Kläser univentionstaff 2016-07-05 11:59:40 CEST
cf. Bug 41222, Comment 3:
> [...]
> The module is currently still not translated, see also Bug 41187. The reason
> for this is two-fold. Firstly, there is no
> debian/univention-saml.umc-modules file (i.e., the module description
> contained in the XML module file is not translated). Secondly, the de.po
> file is in the package root file and not below
> modules/univention/admin/handlers/saml. AFAIS, this needs to be changed via
> Bug 41187.

These two discussed changes should be applied via this bug. Then the translation will be fine.
Comment 2 Alexander Kläser univentionstaff 2016-07-05 12:07:35 CEST
(In reply to Alexander Kläser from comment #1)
> cf. Bug 41222, Comment 3:
> > [...]
> > Secondly, the de.po file is in the package root file and not below
> > modules/univention/admin/handlers/saml. AFAIS, this needs to be changed via
> > Bug 41187.

Incorrect, the second part is fine.
Comment 3 Alexander Kläser univentionstaff 2016-07-05 12:15:33 CEST
See also the ucs-school-umc-common package as an example which only contains a XML module file, as well.
Comment 4 Florian Best univentionstaff 2016-07-20 14:04:27 CEST
Created attachment 7818 [details]
pseudo patch

Here a starting point. IMHO we should adjust dh-umc-module-{install,build} to have parameters --ignore-python --ignore-javascript to make it possible to translate flavor-only modules. ucs-school-umc-common uses --core which is wrong.
Comment 5 Eduard Mai univentionstaff 2016-07-21 12:48:05 CEST
Created attachment 7819 [details]
workaround without changes in dh-umc*

This patch works around the problem dh-umc-module-install -c creating umc-core.mo instead of a dedicated .mo file.
Comment 6 Alexander Kläser univentionstaff 2016-10-19 15:32:38 CEST
AFAIS, if "Module: udm-saml" is specified, the rm + msgfmt as well as the translationId (which is especially for links in UMC) should then be unnecessary.

---------- 8< ----------
--- a/saml/univention-saml/debian/rules
+++ b/saml/univention-saml/debian/rules
@@ -27,13 +27,22 @@
 # License with the Debian GNU/Linux or Univention distribution in file
 # /usr/share/common-licenses/AGPL-3; if not, see
 # <http://www.gnu.org/licenses/>.
+override_dh_auto_build:
+	dh-umc-module-build -c
+	dh_auto_build
 
 override_dh_auto_install:
+	dh-umc-module-install -c
+	# fix translation
+	rm debian/univention-saml/usr/share/univention-management-console/i18n/de/umc-core.mo
+	mkdir -p usr/share/univention-management-console/i18n/de
+	msgfmt --check --output-file=usr/share/univention-management-console/i18n/de/udm-saml.mo umc/de.po
 	dh_auto_install
 	univention-install-config-registry

--- /dev/null
+++ b/saml/univention-saml/debian/univention-saml.umc-modules
@@ -0,0 +1,6 @@
+Module: umc-core
+Python:
+Category: none
+Definition: umc/saml-serviceprovider.xml
+Javascript:
+Icons: umc/icons

--- a/saml/univention-saml/umc/saml-serviceprovider.xml
+++ b/saml/univention-saml/umc/saml-serviceprovider.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--DOCTYPE umc SYSTEM "branches/ucs-3.1/ucs/management/univention-management-console/doc/module.dtd"-->
 <umc version="2.0">
-	<module id="udm" icon="udm-saml-serviceprovider" version="1.0">
+	<module id="udm" translationId="udm-saml" icon="udm-saml-serviceprovider" version="1.0">
 		<name/>
 		<description/>
 		<keywords/>
---------- 8< ----------
Comment 7 Eduard Mai univentionstaff 2016-10-19 16:22:33 CEST
(In reply to Alexander Kläser from comment #6)
> AFAIS, if "Module: udm-saml" is specified, the rm + msgfmt as well as the
> translationId (which is especially for links in UMC) should then be

From dh_umc.py:
218 »   »   if core:
219 »   »   »   if module.module_name != 'umc-core' or not module.xml_categories:
220 »   »   »   »   raise ValueError('Module definition does not match core module')
Comment 8 Florian Best univentionstaff 2016-10-19 16:50:28 CEST
Btw: in UCS 4.2 modules without python/javascript don't need --core anymore! --core was for the UMC-Server core and was misused for e.g. ucs-school-branding and univention-saml.
Comment 9 Eduard Mai univentionstaff 2016-10-19 19:10:02 CEST
(In reply to Alexander Kläser from comment #6)
> AFAIS, if "Module: udm-saml" is specified, the rm + msgfmt as well as the
> translationId (which is especially for links in UMC) should then be
> unnecessary.

To clarify, after further investigation this is now the definition of the .umc-modules file:
Module: umc-core
Category: none
Definition: umc/saml-serviceprovider.xml
Icons: umc/icons

Module must be 'umc-core' and Category must be set in order to use dh-umc-module-{install,build} with -c option. The translationId attribute is needed because otherwise the message string of the module definition be will looked up in /usr/share/univention-management-console/i18n/{language_code}/udm.mo, were it is not included.

I adjusted the changes to move umc-core.mo instead of deleting and rebuilding it.

r73372: applied fix as described above.

UCS 4.1-3:
Package: univention-saml
Version: 3.0.27-6.105.201610191908
Comment 10 Eduard Mai univentionstaff 2016-10-19 19:13:25 CEST
r73373: YAML
Comment 11 Alexander Kläser univentionstaff 2016-11-01 14:08:09 CET
I needed to add a call to refresh-i18n in the source package. The mo file was outdated. Afterwards everything was correctly translated.

univention-saml (3.0.27-7):
r73972 | Bug #41187: update .mo file

univention-saml.yaml:
r73974 | Bug #41187: update package version

Changes: OK
→ "umc-core" needs to be specified.
→ The .mo file should be generated during the build process, but let's leave it
  like that for the moment.


I synced my changes to 4.1-4 (I removed the YAML file via the revert):

univention-saml (3.0.27-7):
r73976 | Bug #41187: update .mo file

univention-saml.yaml:
r73977 | Revert "Bug #41187: fixes translation of the module description"
r73975 | Bug #41187: fixes translation of the module description


... and 4.2-0 (previous commits were missing):

univention-saml (4.0.0-7):
r73979 | Bug #41187: update .mo file
r73978 | Bug #41187: fixes translation of the module description
Comment 12 Janek Walkenhorst univentionstaff 2016-11-03 11:32:40 CET
<http://errata.software-univention.de/ucs/4.1/320.html>