Univention Bugzilla – Full Text Bug Listing |
Summary: | Plural forms cannot be translated properly at various places in the UCS code | ||
---|---|---|---|
Product: | UCS | Reporter: | Richard Ulmer <ulmer> |
Component: | UMC (Generic) | Assignee: | Richard Ulmer <ulmer> |
Status: | CLOSED FIXED | QA Contact: | Alexander Kläser <klaeser> |
Severity: | normal | ||
Priority: | P5 | CC: | best, gohmann, klaeser, requate |
Version: | UCS 4.2 | Keywords: | interim-1 |
Target Milestone: | UCS 4.2 | ||
Hardware: | Other | ||
OS: | Linux | ||
See Also: | https://forge.univention.org/bugzilla/show_bug.cgi?id=42293 | ||
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?: | 5: Will affect all installed domains | How will those affected feel about the bug?: | 1: Nuisance – not a big deal but noticeable |
User Pain: | 0.057 | Enterprise Customer affected?: | |
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | Bug group (optional): | Internationalization | |
Max CVSS v3 score: | |||
Bug Depends on: | |||
Bug Blocks: | 41221 | ||
Attachments: |
Typos with .po files and descriptions
Proposed translations for the new strings in the umc/js/de.po |
Description
Richard Ulmer
2016-09-01 15:05:22 CEST
This is more of an advice and can't be fixed without further research or a conversation with a translator. ucsschool/ucs-school-umc-wizards/umc/js/de.po No %(objPlural)s could be found => (Such constructs assuming a plural bring translation problems. First, some languages use more than two plural forms - Russian, Bosniac, Irish, etc. Second, "No" in English is translated to "Aucun" in French, and "No" is followed by plural and "Aucun" by singular! Better use support for "plural forms" as offered by gettext utilities.) See also: https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html Another example: ucs/management/univention-appcenter/umc/python/appcenter/de.po some -> (please don't use combinatory translations like this one. in French, it's not the same translation when it refers to masculine or feminine words) With Bug 42289 being fixed, we can use plural forms. However, for this we will need the plural function ngettext. Then we can use plural forms, e.g.: ---------- 8< --------- $ cat > test.js <<EOM // t10n: test console.log(_('Translate me!')); console.log(_.ngettext('%d thing', '%d things', n)); EOM $ xgettext --force-po --from-code=UTF-8 --sort-output --package-name=test \ --language JavaScript --add-comments=t10n -o test.po test.js $ tail -n 11 test.po #: test.js:3 #, javascript-format msgid "%d thing" msgid_plural "%d things" msgstr[0] "" msgstr[1] "" #. t10n: test #: test.js:2 msgid "Translate me!" msgstr "" ---------- 8< --------- Json files should now be generated correctly from po files with plural forms. svn commit: 72455 (In reply to Richard Ulmer from comment #5) > Json files should now be generated correctly from po files with plural forms. > > svn commit: 72455 Missing import of 're' module in dev/dh_umc.py Traceback: File "/usr/lib/pymodules/python2.7/univention/dh_umc.py", line 359, in create_json_file data[entry.msgid] = tmp_lst UnboundLocalError: local variable 'tmp_lst' referenced before assignment I fixed comment #6 and comment #7. univention-management-console (9.0.12-5): r72528 | Bug #42220: Fix create_json_file() The function create_json_file() has raises more specific errors now, catches more errors and got prettified. svn commit: 72885 I prettified the code from comment #9 further, after getting feedback from Florian. svn commit: 72890 Please adjust the workaround for plural forms in univention-management-console-module-udm once the JavaScript code is committed. The _.ngettext function has been implemented in /management/univention-web/js/i18n.js svn commit: 72925 univention-management-console-module-udm has been adjusted. ngettext() is used multiple times and seems to work correctly. svn commit: 72996 I've further prettified the code after getting feedback from Florian. svn commit: 73006 I found two more typos and fixed them. svn commit: 73108 Created attachment 8092 [details]
Proposed translations for the new strings in the umc/js/de.po
Please make sure the package univention-management-console-module-udm can be build for UCS 4.2! It fails with: dh-umc-module-build .......... done. .................................................................................................................................................................................................................................................................. done. There are plural forms in umc/js/de.po, but no rules in the file's header. Setting to REOPEN. The de.po file has been committed, so the package should build now. svn commit: 73248 (de.po) svn commit: 73249 (changelog) Thank you, yes it did. Changes: OK, plural forms work in JavaScript nicely Changelog: FAIL, please add a changelog entry for this bug → REOPEN (In reply to Alexander Kläser from comment #22) > Changes: OK, plural forms work in JavaScript nicely > Changelog: FAIL, please add a changelog entry for this bug > > → REOPEN I added the changelog entry [r76786]. svn r73006 introduces the following syntax error: b/management/univention-management-console-module-udm/umc/js/udm/CreateReportDialog.js +» » » » var text = lang.replace(_('The {type} can be downloaded at<br><br><a target="_blank" href="{href}">{obj}</a>'), +» » » » {type, href, obj}); I will fix this in Bug #43751. I fixed several syntax errors due to missing { } brackets. r78428 | Bug #42220: fix syntax errors UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug". |