Bug 53362 - Add support for UMC translation file in ucs_registerLDAPExtension
Add support for UMC translation file in ucs_registerLDAPExtension
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 4.4-8-errata
Assigned To: Christian Castens
Max Pohle
:
Depends on:
Blocks: 53754 53532
  Show dependency treegraph
 
Reported: 2021-06-01 13:56 CEST by Felix Botner
Modified: 2021-09-06 17:10 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
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 Felix Botner univentionstaff 2021-06-01 13:56:48 CEST
Currently UMC translation files ((usr/share/univention-management-console/i18n/de/*.mo) can not be registered. This should be possible.

Idea:

-> ucs_registerLDAPExtension --udm_module /usr/share... --umcregistration /usr/share...xml --udm --umcmessagecatalog /usr/share/myapp/umc/de-myTranslationID.mo # --umcmessagecatalog is new
-> udm settings/udm_module ... --append umcmessagecatalog "de myTranslationID YF65676FFFZT..."
-> LDAP univentionUMCMessageCatalog;entry-lang-de-myTranslationID:: YF65676FFFZT...
-> Listner (udm_extension.py) writes /usr/share/univention-management-console/i18n/de/myTranslationID.mo

Steps:
 * univention-ldap - new attribute univentionUMCMessageCatalog for univentionUDMModule
 * univention-directory-manager-modules - support umcmessagecatalog in settings/udm_module
 * univention-lib - support --umcmessagecatalog in ucs_registerLDAPExtension
 * univention-directory-manager-modules - install/remove umcmessagecatalog in udm_extension.py
Comment 1 Florian Best univentionstaff 2021-06-01 17:24:30 CEST
(In reply to Felix Botner from comment #0)

> -> LDAP univentionUMCMessageCatalog;entry-lang-de-myTranslationID::
> YF65676FFFZT...

This is 1. wrong and 2. not a good idea. It's either "lang-de" or "entry-*". The attributeoption "lang-" is predefined (for languages).
You could mix them: univentionUMCMessageCatalog;lang-de;entry-myTranslationID.

But be aware, that they should not be longer than 24 chars as said in:
https://datatracker.ietf.org/doc/html/rfc4520#section-3.5

A different approach would be to store this information in the metadata of the "mo" file format.
It contains already the language:

# grep -a ^Language: /usr/share/univention-management-console/i18n/de/quota.mo
Language: de

Maybe an additional field can be used?
Comment 2 Felix Botner univentionstaff 2021-06-02 09:27:26 CEST
(In reply to Florian Best from comment #1)
> (In reply to Felix Botner from comment #0)
> 
> > -> LDAP univentionUMCMessageCatalog;entry-lang-de-myTranslationID::
> > YF65676FFFZT...
> 
> This is 1. wrong and 2. not a good idea. It's either "lang-de" or "entry-*".
> The attributeoption "lang-" is predefined (for languages).
> You could mix them:
> univentionUMCMessageCatalog;lang-de;entry-myTranslationID.
> 
> But be aware, that they should not be longer than 24 chars as said in:
> https://datatracker.ietf.org/doc/html/rfc4520#section-3.5
> 
> A different approach would be to store this information in the metadata of
> the "mo" file format.
> It contains already the language:
> 
> # grep -a ^Language:
> /usr/share/univention-management-console/i18n/de/quota.mo
> Language: de
> 
> Maybe an additional field can be used?

we already use ";entry-lang-de" for udm messagecatalogs, but if that "grep language" thing works, i'm fine with that (and entry-myTranslationID for the name of the file)
Comment 3 Florian Best univentionstaff 2021-06-02 09:47:02 CEST
>>> import polib
>>> m = polib.mofile('/usr/share/univention-management-console/i18n/de/quota.mo')
>>> m.metadata['Language']
u'de'
Comment 4 Christian Castens univentionstaff 2021-06-30 09:57:47 CEST
UCS 4.4-8:
f61968b46e8d3d9ec39dc924572e40cbfdf7cc46 - UMC translation file registration
c3748f701a1d1240056ff8629257e760a30308d1 - yamls

Packages changed:

Package: univention-lib
Version: 8.0.1-43A~4.4.0.202106291403
Branch: ucs_4.4-0
Scope: errata4.4-8

Package: univention-directory-manager-modules
Version: 14.0.20-12A~4.4.0.202106291412
Branch: ucs_4.4-0
Scope: errata4.4-8

Package: univention-ldap
Version: 15.0.3-4A~4.4.0.202106291430
Branch: ucs_4.4-0
Scope: errata4.4-8

Package: ucs-test
Version: 9.0.7-37A~4.4.0.202106291434
Branch: ucs_4.4-0
Scope: errata4.4-8


ucs_registerLDAPExtension from the Univention shell function library 
now allows the option "umcmessagecatalog". This option can be used to 
supply translation files in GNU message catalog format for the UMC.

Test 72_udm-extensions/33_umcmessagecatalog has been added.

The changes have yet to be ported to UCS 5
Comment 5 Max Pohle univentionstaff 2021-07-05 16:13:10 CEST
I can confirm, that the change works for UCS4.

With this change the `.inst`-file can now contain a `umcmessagecatalog` as a parameter for `registerLDAPExtension` in order to install a `.mo`-translation-file for example under:

```
/usr/share/univention-management-console/i18n/de/udm-$appname.mo
```

where `$appname` has to be replaced, of cause. That way the udm-module tile title can be translated by application vendors among other possibilities.
Comment 6 Daniel Tröder univentionstaff 2021-08-24 09:09:48 CEST
Why has this not been released?