[Bug 37781] New: Add translation context for "On" (when used alone)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Bug ID: 37781 Summary: Add translation context for "On" (when used alone) Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: I18N/L10N Assignee: koha-bugs@lists.koha-community.org Reporter: caroline.cyr-la-rose@inlibro.com QA Contact: testopia@bugs.koha-community.org CC: f.demians@tamil.fr, jonathan.druart@gmail.com There are two places (according to the translation tool) that have the string "On" used alone. The two cases have different contexts: In smtp_servers.tt, "On" is used in opposition to "Off" for the debugging mode. In itemsearch.tt, "On" is used for a date, "After [date]", "Before [date]", "On [date]" In French these would be two different words, but as it is, the same string is used in both cases. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- +1 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |String patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 --- Comment #2 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 170881 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170881&action=edit Bug 37781: Add translation context for "On" (when used alone) This patch adds context to the string "On" used alone in the item search page, to mean "On a specific date". To test: 1. Update translation files gulp po:update --lang fr-CA 2. Check the staff-prog.po file and search for "On". vi misc/translator/po/fr-CA-staff-prog.po /"On" --> It should be in three places, two in itemsearch.tt and one in smtp_servers.tt 38415 #. For the first occurrence, 38416 #. SCRIPT 38417 #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:327 38418 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 38419 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 38420 #, c-format 38421 msgid "On" 38422 msgstr "Sur " 3. Apply patch 4. Reupdate po files gulp po:update --lang fr-CA 5. Check the messages.po file and search for "On" --> There should be a msgctxt line that adds context to the "On" (please ignore the translated msgstr, I have no idea how it decides what to put in there!) 6266 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 6267 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 6268 #, fuzzy 6269 msgctxt "On specific date" 6270 msgid "On" 6271 msgstr "Oman" 6. Also check the item search page --> It should still work and the "On" in the last borrowed date drop-down should still say "On" 7. Optionally, translate the string and remove the "#fuzzy", install the translation and check the item search page --> It should use the string you put in -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 --- Comment #3 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- I made a patch for the itemsearch.tt page, but I need help for the smtp_servers.tt page. I tried to change return _("On"); for return _("On","Active"); return _p("Active", "On"); return _p('Active', 'On'); return __p("Active","On"); return __p('Active','On'); ... All of these effectively remove the string from fr-CA-staff-prog.po, but they don't add it back with the context in messages.po or message-js.po. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- If you are in a .tt files writing JS code, you cannot use the JS functions defined in i18n.js (__, __p, etc.) Only strings within _() will be picked. You can however use the TT plugin: tp("Active", "On") Full code would be: "data": function( row, type, val, meta ) { if ( row.debug ) { return "[% tp("Active", "On") | html %]"; } else { return "[% tp("Active", "Off") | html %]"; } }, % gulp po:update --lang fr-FR % git grep -C 2 'msgctxt "Active"' fr-FR* fr-FR-messages.po-#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:404 fr-FR-messages.po-#, fuzzy fr-FR-messages.po:msgctxt "Active" fr-FR-messages.po-msgid "On" fr-FR-messages.po-msgstr "Oman" fr-FR-messages.po- fr-FR-messages.po-#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:407 fr-FR-messages.po:msgctxt "Active" fr-FR-messages.po-msgid "Off" fr-FR-messages.po-msgstr "" (No idea where "Oman" is coming from!) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170881|0 |1 is obsolete| | --- Comment #5 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 171033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171033&action=edit Bug 37781: Add translation context for "On" (when used alone) This patch adds context to the string "On" used alone in the item search page, to mean "On a specific date". To test: 1. Update translation files gulp po:update --lang fr-CA 2. Check the staff-prog.po file and search for "On". vi misc/translator/po/fr-CA-staff-prog.po /"On" --> It should be in three places, two in itemsearch.tt and one in smtp_servers.tt #. For the first occurrence, #. SCRIPT #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:327 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 #, c-format msgid "On" msgstr "Sur " 3. Apply patch 4. Reupdate po files gulp po:update --lang fr-CA 5. Check the messages.po file and search for "On" --> There should be a msgctxt line that adds context to the "On" (please ignore the translated msgstr, I have no idea how it decides what to put in there!) #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:404 #, fuzzy msgctxt "Active" msgid "On" msgstr "Oman" #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 #, fuzzy msgctxt "On specific date" msgid "On" msgstr "Oman" 6. Also check the item search page --> It should still work and the "On" in the last borrowed date drop-down should still say "On" 7. In the SMTP servers page, add a server and enable the "Debug" mode. --> In the list of servers, the Debug column should still say simply "On" 8. Optionally, translate the string and remove the "#fuzzy" line, install the translation and check the item search page --> It should use the string you put in Bug 37781: Add translation context for "On" (when used alone) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |caroline.cyr-la-rose@inlibr |ity.org |o.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 --- Comment #6 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Thanks Jonathan! I added the context like you said and it works (not sure where the Oman comes from either lol). I had to do a little bit of more advanced git, hopefully I didn't lose anything and didn't make a mess of things either... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171033|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 171169 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171169&action=edit Bug 37781: Add translation context for "On" (when used alone) This patch adds context to the string "On" used alone in the item search page, to mean "On a specific date". To test: 1. Update translation files gulp po:update --lang fr-CA 2. Check the staff-prog.po file and search for "On". vi misc/translator/po/fr-CA-staff-prog.po /"On" --> It should be in three places, two in itemsearch.tt and one in smtp_servers.tt #. For the first occurrence, #. SCRIPT #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:327 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 #, c-format msgid "On" msgstr "Sur " 3. Apply patch 4. Reupdate po files gulp po:update --lang fr-CA 5. Check the misc/translator/po/fr-CA-messages.po file and search for "On" --> There should be a msgctxt line that adds context to the "On" (please ignore the translated msgstr, I have no idea how it decides what to put in there!) #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:404 #, fuzzy msgctxt "Active" msgid "On" msgstr "Oman" #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 #, fuzzy msgctxt "On specific date" msgid "On" msgstr "Oman" 6. Also check the item search page --> It should still work and the "On" in the last borrowed date drop-down should still say "On" 7. In the SMTP servers page, add a server and enable the "Debug" mode. --> In the list of servers, the Debug column should still say simply "On" 8. Optionally, translate the string and remove the "#fuzzy" line, install the translation and check the item search page --> It should use the string you put in Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171169|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171188&action=edit Bug 37781: Add translation context for "On" (when used alone) This patch adds context to the string "On" used alone in the item search page, to mean "On a specific date". To test: 1. Update translation files gulp po:update --lang fr-CA 2. Check the staff-prog.po file and search for "On". vi misc/translator/po/fr-CA-staff-prog.po /"On" --> It should be in three places, two in itemsearch.tt and one in smtp_servers.tt #. For the first occurrence, #. SCRIPT #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:327 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 #, c-format msgid "On" msgstr "Sur " 3. Apply patch 4. Reupdate po files gulp po:update --lang fr-CA 5. Check the misc/translator/po/fr-CA-messages.po file and search for "On" --> There should be a msgctxt line that adds context to the "On" (please ignore the translated msgstr, I have no idea how it decides what to put in there!) #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt:404 #, fuzzy msgctxt "Active" msgid "On" msgstr "Oman" #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:322 #: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:324 #, fuzzy msgctxt "On specific date" msgid "On" msgstr "Oman" 6. Also check the item search page --> It should still work and the "On" in the last borrowed date drop-down should still say "On" 7. In the SMTP servers page, add a server and enable the "Debug" mode. --> In the list of servers, the Debug column should still say simply "On" 8. Optionally, translate the string and remove the "#fuzzy" line, install the translation and check the item search page --> It should use the string you put in Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | Text to go in the| |This enhancement adds release notes| |translation context to the | |word "On" when it is used | |alone. In the item search | |page, it means "on a | |specific date", and on the | |SMTP server administration | |page, it means "on" as in | |"not off". The translation | |context separates the two | |strings so that they can be | |translated individually. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37781 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED CC| |lucas@bywatersolutions.com Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org