Univention Bugzilla – Bug 53362
Add support for UMC translation file in ucs_registerLDAPExtension
Last modified: 2021-09-06 17:10:27 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
(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?
(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)
>>> import polib >>> m = polib.mofile('/usr/share/univention-management-console/i18n/de/quota.mo') >>> m.metadata['Language'] u'de'
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
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.
Why has this not been released?
<https://errata.software-univention.de/#/?erratum=4.4x1032> <https://errata.software-univention.de/#/?erratum=4.4x1033> <https://errata.software-univention.de/#/?erratum=4.4x1036>