[Bug 20988] New: Internationalization: wrap all translatable text inside t() calls
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Bug ID: 20988 Summary: Internationalization: wrap all translatable text inside t() calls Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: I18N/L10N Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: frederic@tamil.fr Depends on: 15395 Bug 15395's Koha::I18n is working well, but it is basically useless until we wrap all the translatable strings inside __*() calls (or t*() calls inside templates). This bug aims to do that. I wrote a little tool to automatically find and replace translatable text by the corresponding call. It can be found here : https://github.com/jajm/koha-i18n. This bug will hold a few patches that will make koha-i18n work better and I'll try to attach all the changes it does. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15395 [Bug 15395] Internationalization: plural forms, context, and more -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76333 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76333&action=edit Bug 20988: Modify templates so that they can be parsed as HTML This is required for koha-i18n [1] to work correctly [1] https://github.com/jajm/koha-i18n -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76334 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76334&action=edit Bug 20988: Allow to create po for all languages at once This is required for the script that comes with koha-i18n, which creates the new PO files and fill them with existing translations. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76335&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/includes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76336 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76336&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/help -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76337 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76337&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76338&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76339 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76339&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/acqui -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76340&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/admin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76341&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/authorities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76342 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76342&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/basket -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76343 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76343&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76344&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76345 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76345&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/circ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #14 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76346 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76346&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/clubs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #15 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76347&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #16 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76348 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76348&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/labels -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #17 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76349&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/members -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #18 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76350 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76350&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/onboarding -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #19 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76351 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76351&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #20 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76352 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76352&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/patroncards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #21 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76353 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76353&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/plugins -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #22 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76354 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76354&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/installer -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #23 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76355 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76355&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/reports -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #24 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76356 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76356&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #25 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76357 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76357&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/serials -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #26 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76358 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76358&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/tools -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #27 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76359 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76359&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #28 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76360 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76360&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #29 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76361 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76361&action=edit Bug 20988: koha-tmpl/opac-tmpl/bootstrap/en/includes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #30 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76362 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76362&action=edit Bug 20988: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #31 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76363 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76363&action=edit Bug 20988: koha-tmpl/opac-tmpl/bootstrap/en/modules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #32 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76364 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76364&action=edit Bug 20988: koha-tmpl/intranet-tmpl/prog/en/modules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #33 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76365&action=edit Bug 20988: Add a sample of a translated PO file PO files are too big to be attached on Bugzilla, so here's a gzipped version of misc/translator/po/fr-FR-messages.po as generated by create-messages.sh (found in https://github.com/jajm/koha-i18n) After applying the patch, run gunzip misc/translator/po/fr-FR-messages.po.gz A few numbers about this PO file: - Number of messages: 14178 - Number of translated messages: 13631 - Number of non-fuzzy translated messages: 9720 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #34 from Julian Maurice <julian.maurice@biblibre.com> --- All theses patches (except the first two) were generated with the following commands: koha-i18n --in-place koha-tmpl/**/en/**/*.tt koha-tmpl/**/en/**/*.inc # might be a zsh'ism, haven't tried with bash cd misc/translator && $GOPATH/src/github.com/jajm/koha-i18n/scripts/create-messages.sh -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #35 from Julian Maurice <julian.maurice@biblibre.com> --- Test plan: 1. Apply bug 15395 2. Apply the first two patches of this bug 3. Install koha-i18n (see the README) 4. Run koha-i18n on all .tt and .inc files 5. cd to misc/translator and run $GOPATH/src/github.com/jajm/koha-i18n/scripts/create-messages.sh 6. Run ./translate install fr-FR # or any available language 7. Reload starman 8. Go to Koha with your browser, switch language to fr-FR and check that the strings translated in misc/translator/fr-FR-messages.po are translated in the interface. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 paxed <pasi.kallinen@joensuu.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pasi.kallinen@joensuu.fi --- Comment #36 from paxed <pasi.kallinen@joensuu.fi> --- Unfortunately quite a lot of the messages are split in multiple parts, making translation very hard: [% t('Warning: This file is version') %] [% message.upload_version %][% t(', but I only know how to import version') %] [% message.current_version %][% t('. I\'ll try my best.') %] Currently they're much better, with placeholders: "Warning: This file is version %s, but I only know how to import version %s. " -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #37 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to paxed from comment #36)
Unfortunately quite a lot of the messages are split in multiple parts, making translation very hard:
[% t('Warning: This file is version') %] [% message.upload_version %][% t(', but I only know how to import version') %] [% message.current_version %][% t('. I\'ll try my best.') %]
Currently they're much better, with placeholders:
"Warning: This file is version %s, but I only know how to import version %s. "
I agree. There's still some manual work, the goal of this bug is to reduce it to a minimum. This particular example should be [% tx('Warning: This file is version {upload_version} but I only know how to import {current_version}. I\'ll try my best.', { upload_version = upload_version, current_version = current_version) %] I'm not sure we can accomplish that easily with an automated tool. It's probably easier to run the tool and fix manually the problematic ones. But please note that, unlike actual PO files, the one attached doesn't contain strings like this: "%s %s %s %s %s - %s %s %s - %s%s %s- %s%s %s - %s%s %sEdition: %s%s " "%s ; %s%s %s - %s%s %s ; %s%s %s " Also, I attached all the changes to this one bug, but that doesn't mean we should do it all at once. We can take the safer way of changing one template file at a time (or one module at a time). It will certainly be easier to rebase/test/review. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #38 from paxed <pasi.kallinen@joensuu.fi> --- BTW, my take on reducing the number of TT placeholders is in bug 12221 (In reply to Julian Maurice from comment #37)
But please note that, unlike actual PO files, the one attached doesn't contain strings like this:
"%s %s %s %s %s - %s %s %s - %s%s %s- %s%s %s - %s%s %sEdition: %s%s " "%s ; %s%s %s - %s%s %s ; %s%s %s "
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #39 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to paxed from comment #38)
BTW, my take on reducing the number of TT placeholders is in bug 12221
I wasn't aware of this bug, thanks. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #40 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76934&action=edit Bug 20988: Add template macros to ease template rewriting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76335|0 |1 is obsolete| | Attachment #76336|0 |1 is obsolete| | Attachment #76337|0 |1 is obsolete| | Attachment #76338|0 |1 is obsolete| | Attachment #76339|0 |1 is obsolete| | Attachment #76340|0 |1 is obsolete| | Attachment #76341|0 |1 is obsolete| | Attachment #76342|0 |1 is obsolete| | Attachment #76343|0 |1 is obsolete| | Attachment #76344|0 |1 is obsolete| | Attachment #76345|0 |1 is obsolete| | Attachment #76346|0 |1 is obsolete| | Attachment #76347|0 |1 is obsolete| | Attachment #76348|0 |1 is obsolete| | Attachment #76349|0 |1 is obsolete| | Attachment #76350|0 |1 is obsolete| | Attachment #76351|0 |1 is obsolete| | Attachment #76352|0 |1 is obsolete| | Attachment #76353|0 |1 is obsolete| | Attachment #76354|0 |1 is obsolete| | Attachment #76355|0 |1 is obsolete| | Attachment #76356|0 |1 is obsolete| | Attachment #76357|0 |1 is obsolete| | Attachment #76358|0 |1 is obsolete| | Attachment #76359|0 |1 is obsolete| | Attachment #76360|0 |1 is obsolete| | Attachment #76361|0 |1 is obsolete| | Attachment #76362|0 |1 is obsolete| | Attachment #76363|0 |1 is obsolete| | Attachment #76364|0 |1 is obsolete| | Attachment #76365|0 |1 is obsolete| | Attachment #76934|0 |1 is obsolete| | --- Comment #41 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 76935 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76935&action=edit Bug 20988: Add template macros to ease template rewriting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #42 from Julian Maurice <julian.maurice@biblibre.com> --- There's a new version of koha-i18n, written in Perl this time. It is available at the same URL (https://github.com/jajm/koha-i18n). It tries to wrap longer strings, so it should address comment 36. I obsoleted all generated patches, the result can be seen here: https://gitlab.com/jajm/Koha/commits/bug/20988 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com --- Comment #43 from Michal Denar <black23@gmail.com> --- Any testplan? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #44 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Michal Denar from comment #43)
Any testplan?
Yes, see comment 35 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #45 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Is it possible to use double-quotes ? [% t("translate me") %] Because actually translations are made for text with double quotes especially for JavaScript. Because some translated text can add a single quote like : today => aujourd'hui -- You are receiving this mail because: You are watching all bug changes.
Is it possible to use double-quotes ? [% t("translate me") %] Because actually translations are made for text with double quotes especially for JavaScript. Because some translated text can add a single quote like : today => aujourd'hui You can use single quotes or double quotes. It doesn't matter since strings are
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #46 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Fridolin SOMERS from comment #45) translated at runtime (and not replaced in the source file like `./translate install` does). So you can write [% t('A string with "double quotes"') %] and [% t("A string with 'single quotes'") %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Bug 20988 depends on bug 15395, which changed state. Bug 15395 Summary: Internationalization: plural forms, context, and more https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15395 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #47 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- (In reply to Julian Maurice from comment #46)
(In reply to Fridolin SOMERS from comment #45)
Is it possible to use double-quotes ? [% t("translate me") %] Because actually translations are made for text with double quotes especially for JavaScript. Because some translated text can add a single quote like : today => aujourd'hui You can use single quotes or double quotes. It doesn't matter since strings are translated at runtime (and not replaced in the source file like `./translate install` does).
So you can write [% t('A string with "double quotes"') %] and [% t("A string with 'single quotes'") %]
Ah of course. Nice ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_20_05_target CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bdiazmunoz@gmail.com, | |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #48 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I lost track of this one.. not sure what the next steps are? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_20_05_candidate |rel_20_11_target --- Comment #49 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- At this point I think it's probably one for early in the 20.11 cycle.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #50 from Owen Leonard <oleonard@myacpl.org> --- I think it would be better to have some patches on this bug which are proof-of-concept rather than trying to update everything at once. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #51 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Owen Leonard from comment #50)
I think it would be better to have some patches on this bug which are proof-of-concept rather than trying to update everything at once.
I was thinking maybe one template at a time in separate bugs ? Easier to test and QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #52 from Victor Grousset/tuxayo <victor@tuxayo.net> --- +1 for proof-of-concept Maybe also one template at a time, I don't know. Maybe beginning with the proof-of-concepts and see if it's necessary to keep doing one by one? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26392 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26392 [Bug 26392] Wrap all translatable strings in opac-main.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #53 from Julian Maurice <julian.maurice@biblibre.com> --- I opened bug 26392 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Internationalization: wrap |[OMNIBUS] |all translatable text |Internationalization: wrap |inside t() calls |all translatable text | |inside t() calls Status|Patch doesn't apply |BLOCKED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #54 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Julian, I'd like to know if we need this one or not, for 21.05. Could you send an email to koha-devel with a pro/con list and detail what is done here? Then a vote at a dev meeting will release the situation here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_20_11_target |rel_21_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #55 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I am getting an error: Template process failed: file error - recursion into 'i18n.inc' at /kohadevbox/koha/C4/Templates.pm line 121 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #56 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #55)
I am getting an error: Template process failed: file error - recursion into 'i18n.inc' at /kohadevbox/koha/C4/Templates.pm line 121
ok, fixed. bin/koha-i18n ~/path/to/koha/**/*.tt ~/path/to/koha/**/*.inc then remove the changes generated to i18n.inc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #57 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- 1. Item search is broken, invalid JSON. 2. /members/members-home.pl Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt line 153: unexpected token (") [% " s_o | html %] at /kohadevbox/koha/C4/Templates.pm line 121 3. /members/moremember.pl?borrowernumber=51 Template process failed: file error - parse error - patron-title.inc line 38: unexpected end of directive [% t('\' %] at /kohadevbox/koha/C4/Templates.pm line 121 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29602 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #58 from Victor Grousset/tuxayo <victor@tuxayo.net> --- In 29602 the question of performance came up. Here will be moved some comments from there. Here are results of the benchmarks of bug 15395 on my laptop with a 2012 CPU (i5-3320M @3.3GHz on mono thread loads) Summary Average for 10 strings without translation: 0.0001145 seconds Average for 100 strings without translation: 0.0001114 seconds Average for 200 strings without translation: 9.82e-05 seconds Average for 500 strings without translation: 0.0001932 seconds Average for 10 strings with translation: 0.0014077 seconds Average for 100 strings with translation: 0.0076227 seconds Average for 200 strings with translation: 0.0120828 seconds Average for 500 strings with translation: 0.0306117 seconds The same PC has a median time of 0.350 sec to generate the untranslated HTML for this page: /cgi-bin/koha/admin/preferences.pl?tab=circulation (using browser network devtools) There are 200 sysprefs shown there. So it's surely one the of the pages with the most translatable strings we have. (Well, searching "a" in sysprefs yields 740 of them ^^" in more than 0.950 sec) git grep "circulation.pref#" misc/translator/po/bg-Cyrl-pref.po | wc -l => 633 So it seems we have 633 strings in our circulation sysprefs. if 500 strings took 0.031 sec in the benchmark then 633 strings => 0.039 sec 0.039 is 11% of 0.350 So we should expected that using t() on all string on this page should add 11% response time to 0.350 sec. Would there be another case where the overhead could be the more perceptible than this? (it's not really perceptible) Is the methodology valid? If so then we shouldn't expect issues about performance. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #59 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Jonathan wrote (bug 29602 comment 17) (In reply to Victor Grousset/tuxayo from comment #16)
Is the methodology valid?
You need to count how many times you enter t() instead of guessing the number of lines matching a pattern there are in a file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #60 from Victor Grousset/tuxayo <victor@tuxayo.net> --- (In reply to Jonathan Druart)
You need to count how many times you enter t() instead of guessing the number of lines matching a pattern there are in a file.
Won't we have one t() usage per string starting with `circulation.pref#` ? Doesn't the above prefix matches all the translatable strings of the page with all the circulation sysprefs? Except the ones on the left and up parts of the UI but in the end the strings of the syspref descriptions and values(dropdowns) dominate the whole page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #61 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Victor Grousset/tuxayo from comment #60)
(In reply to Jonathan Druart)
You need to count how many times you enter t() instead of guessing the number of lines matching a pattern there are in a file.
Won't we have one t() usage per string starting with `circulation.pref#` ?
Doesn't the above prefix matches all the translatable strings of the page with all the circulation sysprefs? Except the ones on the left and up parts of the UI but in the end the strings of the syspref descriptions and values(dropdowns) dominate the whole page.
The exact reason I am suggesting to count how many times you enter the method is that I don't want to think about those questions. Create a global var $i, warn ++$i and you will know. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #62 from Victor Grousset/tuxayo <victor@tuxayo.net> ---
The exact reason I am suggesting to count how many times you enter the method is that I don't want to think about those questions.
Oh, I see.
Create a global var $i, warn ++$i and you will know.
Would that be using the wrapping script on the syspref template and then adding the counter in t in Koha/Template/Plugin/I18N.pm -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #63 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Did you mean Joubu that in order to check, the wrapping script (https://github.com/jajm/koha-i18n) should be used on the syspref template. And then a global counter can be added in the t sub in Koha/Template/Plugin/I18N.pm ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #64 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Victor Grousset/tuxayo from comment #63)
Did you mean Joubu that in order to check, the wrapping script (https://github.com/jajm/koha-i18n) should be used on the syspref template. And then a global counter can be added in the t sub in Koha/Template/Plugin/I18N.pm ?
Yes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #65 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- With the weblate move around the corner and discussions taking place around the different po files we now have and confusion around what does what.. is this worth revisiting? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 --- Comment #66 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Martin Renvoize from comment #65)
With the weblate move around the corner and discussions taking place around the different po files we now have and confusion around what does what.. is this worth revisiting?
Nope, that's not related IMO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Michał <schodkowy.omegi-0r@icloud.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schodkowy.omegi-0r@icloud.c | |om -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20988 Michał <schodkowy.omegi-0r@icloud.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38618 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org