Bug 42260 - Extend translation tools to be able to integrate more special cases
Extend translation tools to be able to integrate more special cases
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-4
Assigned To: Eduard Mai
Alexander Kläser
:
Depends on:
Blocks: 41776 41777 42841 42842 42844 42845
  Show dependency treegraph
 
Reported: 2016-09-05 16:08 CEST by Richard Ulmer
Modified: 2018-05-18 13:53 CEST (History)
6 users (show)

See Also:
What kind of report is it?: Feature Request
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): External feedback, Internationalization, Typo/text changes
Max CVSS v3 score:


Attachments
Proposed patch (1.91 KB, patch)
2016-11-01 11:46 CET, Alexander Kläser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Ulmer univentionstaff 2016-09-05 16:08:16 CEST
+++ This bug was initially created as a clone of Bug #42163 +++

+++ This bug was initially created as a clone of Bug #41221 +++

Apparently univention-ucs-translation-build-package doesn't include the ucs-4.13/management/univention-management-console-frontend/index.html .
Comment 1 Eduard Mai univentionstaff 2016-09-08 17:59:07 CEST
(In reply to Richard Ulmer from comment #0)
> +++ This bug was initially created as a clone of Bug #42163 +++
> 
> +++ This bug was initially created as a clone of Bug #41221 +++
> 
> Apparently univention-ucs-translation-build-package doesn't include the
> ucs-4.13/management/univention-management-console-frontend/index.html .

This is currently not handled correctly through specialcases.json, ideally translationhelper.py needs an adjustment to handle multiple patterns in input_files, for example:

{
        "input_files": ["umc/**js", "*.html"]
        "mo_destination": "usr/share/univention-management-console-frontend/js/umc/i18n/{lang}/app.json",
        "package_dir": "management/univention-management-console-frontend",
        "package_name": "univention-management-console-frontend",
        "po_subdir": "umc",
        "target": "json"
}
Comment 2 Alexander Kläser univentionstaff 2016-09-15 16:18:49 CEST
As discussed:
* Please implement the feature with multiple input_files entries; for this you 
  will probably need the detection of file types (→ python-magic)
* Could you check whether it is possible to scan HTML files for data-i18n 
  attributes; this is relevant for the UCS overview page, EC2 landing page etc.
Comment 3 Alexander Kläser univentionstaff 2016-09-15 16:58:53 CEST
As discussed, please also add an option for referencing a custom specialcases.json file (for UCS@school, Bug 41777).
Comment 4 Alexander Kläser univentionstaff 2016-09-15 17:05:03 CEST
Just to explain the motivation here... in order to update a translation package, we would like to have the minimum amount of manual work. Currently, we need to merge all PO files referenced in additional_targets.mk manually. I would like to avoid this situation.

Once we can integrated most special cases here, we would be able to move the definition of special cases into the package themselves. This in turn would be more flexible and would also allow to use translation routines (à la dh-umc-module-build/dh-umc-module-install) in the packages, replacing the varying currently used methods.
Comment 5 Johannes Keiser univentionstaff 2016-09-16 14:03:04 CEST
r 72640
remove 85_ucs-translation-template dir
Comment 6 Philipp Hahn univentionstaff 2016-10-17 12:50:32 CEST
ucslint
I:0011-16: debian/python-univention-lib.univention-l10n: unknown debhelper file
Comment 7 Eduard Mai univentionstaff 2016-10-18 11:18:40 CEST
r73298 adds:
  * handling of multiple input sources
  * HTML processing logic
  * special case definitions per binary package via debian/*.univention-l10n
r73297: YAML
r73254, r73146: commit special case definitions to affected packages

UCS 4.1-3:
Package: univention-ucs-translation-template
Version: 3.1.0-0.21.201610171630
Comment 8 Eduard Mai univentionstaff 2016-10-18 14:35:58 CEST
r73321: imports debian/ *.univention-l10n files from UCS 4.1-3
r73322, r73320: import changes from UCS 4.1-3 and minor adjustments to xgettext calls

UCS 4.2-0:
Package: univention-ucs-translation-template
Version: 4.1.0-0A~4.2.0.201610181432
Comment 9 Philipp Hahn univentionstaff 2016-10-24 13:08:26 CEST
<http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-3/job/AutotestJoin/lastCompletedBuild/SambaVersion=s3,Systemrolle=master/testReport/85_ucs-translation-template/01_merge_new_module/test/> fails since 8 runs:

>[2016-10-22 23:29:21.840274] Ausgecheckt, Revision 27633.
>(2016-10-22 23:29:22.258178) Usage: univention-ucs-translation-build-package [options] -s source_dir -c language_code -l locale -n language_name
>(2016-10-22 23:29:22.258214) e.g.: -s /path/to/ucs-repository/ -c de -l de_DE.UTF-8:UTF-8 -n Deutsch
>(2016-10-22 23:29:22.258265) 
>(2016-10-22 23:29:22.258314) univention-ucs-translation-build-package: error: no such option: --languagename
>[2016-10-22 23:29:22.273157] Error: Subprocess exited unsuccessfully. Attempted command:
>[2016-10-22 23:29:22.273186] univention-ucs-translation-build-package --source=SVN --languagecode=XX --locale=fr_FR.UTF-8:UTF-8 --languagename=TEST0

packaging/univention-ucs-translation-template/univention-ucs-translation-build-package:
> 48 »···parser.add_option('-n', '--language-name',
                                            ^
Comment 10 Eduard Mai univentionstaff 2016-10-28 20:16:39 CEST
(In reply to Philipp Hahn from comment #9)
> <http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-3/job/
> AutotestJoin/lastCompletedBuild/SambaVersion=s3,Systemrolle=master/
> testReport/85_ucs-translation-template/01_merge_new_module/test/> fails
> since 8 runs:
> 
> >[2016-10-22 23:29:21.840274] Ausgecheckt, Revision 27633.
> >(2016-10-22 23:29:22.258178) Usage: univention-ucs-translation-build-package [options] -s source_dir -c language_code -l locale -n language_name
> >(2016-10-22 23:29:22.258214) e.g.: -s /path/to/ucs-repository/ -c de -l de_DE.UTF-8:UTF-8 -n Deutsch
> >(2016-10-22 23:29:22.258265) 
> >(2016-10-22 23:29:22.258314) univention-ucs-translation-build-package: error: no such option: --languagename
> >[2016-10-22 23:29:22.273157] Error: Subprocess exited unsuccessfully. Attempted command:
> >[2016-10-22 23:29:22.273186] univention-ucs-translation-build-package --source=SVN --languagecode=XX --locale=fr_FR.UTF-8:UTF-8 --languagename=TEST0
> 
> packaging/univention-ucs-translation-template/univention-ucs-translation-
> build-package:
> > 48 »···parser.add_option('-n', '--language-name',
>                                             ^
UCS 4.1-3:
r73852: Fixes --language-name option in test
Package: ucs-test
Version: 6.0.36-39.1550.201610282003

r73856: merge to UCS 4.1-4
r73857: merge to UCS 4.2-0
Comment 11 Eduard Mai univentionstaff 2016-10-28 20:20:07 CEST
UCS 4.1-3:
r73853: minor adjustements to special case handling
Package: univention-ucs-translation-template
Version: 3.1.0-2.23.201610282014

r73854: merge to 4.1-4
r73855: merge to 4.2-0
Comment 12 Eduard Mai univentionstaff 2016-10-28 20:21:38 CEST
r73858: YAML
Comment 13 Florian Best univentionstaff 2016-10-30 00:32:12 CEST
REOPEN:
./packaging/univention-ucs-translation-template/ucr-l10n:48:17: F821 undefined name '_'
Comment 14 Alexander Kläser univentionstaff 2016-10-31 11:06:58 CET
Can you please remove the grep_ucr_translatables script in the root UCS directory.
Comment 15 Alexander Kläser univentionstaff 2016-10-31 11:10:40 CET
(In reply to Eduard Mai from comment #10)
> (In reply to Philipp Hahn from comment #9)
> > <http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-3/job/
> > AutotestJoin/lastCompletedBuild/SambaVersion=s3,Systemrolle=master/
> > testReport/85_ucs-translation-template/01_merge_new_module/test/> fails
> > since 8 runs:
> > [...]
> UCS 4.1-3:
> r73852: Fixes --language-name option in test
> Package: ucs-test
> Version: 6.0.36-39.1550.201610282003
> 
> r73856: merge to UCS 4.1-4
> r73857: merge to UCS 4.2-0

85_ucs-translation-template.01_merge_new_module.test now runs successfully.
Comment 16 Alexander Kläser univentionstaff 2016-10-31 11:31:55 CET
AFAIS, ucr-l10n is currently _not_ installed (should be installed to /usr/share/univention-l10n/ maybe?). This script will be needed by a translation package (i.e., univention-l10n-fr) and it will be called for changes in UCR variables.
Comment 17 Alexander Kläser univentionstaff 2016-10-31 11:32:21 CET
(In reply to Alexander Kläser from comment #16)
> AFAIS, ucr-l10n is currently _not_ installed (should be installed to
> /usr/share/univention-l10n/ maybe?). This script will be needed by a
> translation package (i.e., univention-l10n-fr) and it will be called for
> changes in UCR variables.

Probably the script should go into a different package (binary or even source package?).
Comment 18 Alexander Kläser univentionstaff 2016-11-01 09:44:41 CET
Tagging to 4.1-4. Please add an entry to the 4.1-4 changelog (i.e., no errata YAML files).
Comment 19 Alexander Kläser univentionstaff 2016-11-01 11:46:46 CET
Created attachment 8177 [details]
Proposed patch

This patch adds a new binary package containing the script ucr-l10n.
Comment 20 Eduard Mai univentionstaff 2016-11-02 19:21:09 CET
UCS 4.1-4:
r74035, r74036 apply patch with slight changes. 
Package: univention-ucs-translation-template
Version: 3.1.0-3.24.201611021904

UCS 4.2-0:
r74037: merge to UCS 4.2-0
Comment 21 Alexander Kläser univentionstaff 2016-11-03 13:44:59 CET
I added debian/univention-l10n-tools.install which was missing. (Sorry, I used the wrong bug number in the first commit.) Then everything worked nicely.

univention-ucs-translation-template (3.1.0-5):
r74063 | Bug #41777: added missing debian/univention-l10n-tools.install file
r74065 | Bug #42260: corrected path in debian/univention-l10n-tools.install

... and synced the changes to 4.2-0:

univention-ucs-translation-template (4.1.0-5):
r74067 | Bug #42260: corrected path in debian/univention-l10n-tools.install
r74066 | Bug #42260: added missing debian/univention-l10n-tools.install file

In 4.1-3, I removed the staging YAML file [r74068] and added a 4.1-4 changelog entry [r74070].
Comment 22 Alexander Kläser univentionstaff 2016-11-03 15:00:28 CET
Open points:
* Bug 42842 - Check 4.2-0 merge of package univention-ucs-translation-template
* Bug 42841 - Update section for UCS translation
* Bug 42844 - Integrate translation of UCR variables into univention-ucs-translation-template

Changes: OK, changes work fine.
Merge to 4.2-0: OK... missing merges to 4.2-0 will be handled via Bug 42841.
Changelog 4.1-4: OK... I added the entry [r74070]

→ VERIFIED
Comment 23 Alexander Kläser univentionstaff 2016-11-03 15:11:45 CET
I was missing another point that we discussed:

Bug 42845 - UCS overview entries with UCR variables are not translated into French
Comment 24 Stefan Gohmann univentionstaff 2016-11-08 13:26:37 CET
UCS 4.1-4 has been released:
 https://docs.software-univention.de/release-notes-4.1-4-en.html
 https://docs.software-univention.de/release-notes-4.1-4-de.html

If this error occurs again, please use "Clone This Bug".