[Bug 43972] New: Add translation context for "Archived"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 Bug ID: 43972 Summary: Add translation context for "Archived" Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified 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: caroline.cyr-la-rose@inlibro.com, f.demians@tamil.fr, jonathan.druart@gmail.com, julian.maurice@biblibre.com Target Milestone: --- Depending on what is archived, the word can be translated differently, at least in French. "Archived" when referring to a credit type (masc.) becomes "Archivé" "Archived" when referring to a suggestion (fem.) becomes "Archivée" I propose to add translation context so that we know what is archived and are able to translate it correctly. I grepped the .po files and Archived only appears alone in a couple of places #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt:191 #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt:276 #: koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt:201 #: koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt:1271 #, c-format msgid "Archived" msgstr "Archivé" Elsewhere, it's in a sentence so the context is explicit. -- 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=43972 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 --- Comment #1 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 210174 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210174&action=edit Bug 43972: Add translation context for "Archived" This patch adds translation context for the word "Archived" when used alone so that it can be translated correctly depending on the context where it is used. Test plan TBA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 --- Comment #2 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- I tried something. However I came across some hurdles - The code in the suggestions.tt file was in a JS block and the usual _p('context', 'term') didn't work. ChatGPT suggested I change the string to a tt string to use tp('context', 'term'). I don't know if that is the right way to do it - The Archived term in debit types and credit types is a hidden table column header that never shows up in the interface. I wonder if it really needs to be contextualized or even translated at all. Do I need to declare my usage of AI if I only asked questions to the chat? I didn't find how to add the line. I'm attaching the patch so that y'all can see what I did, but I still need to write a test plan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Caroline Cyr La Rose from comment #2)
I tried something. However I came across some hurdles
- The code in the suggestions.tt file was in a JS block and the usual _p('context', 'term') didn't work. ChatGPT suggested I change the string to a tt string to use tp('context', 'term'). I don't know if that is the right way to do it
JS functions are only available in .js files. From .tt and for JS code you can only use `__()`. If you need the other forms you need to use the TT functions. Note that you should not combine `escape_str()` and `| html`. There are also extra parenthesis around the string. node += '<br /><i class="fa fa-archive"></i> %s'.format("[% tp('Archived suggestion', 'Archived') | html %]");
- The Archived term in debit types and credit types is a hidden table column header that never shows up in the interface. I wonder if it really needs to be contextualized or even translated at all.
If it is never displayed I agree that adding context there adds nothing.
Do I need to declare my usage of AI if I only asked questions to the chat? I didn't find how to add the line.
You can simply add a disclaimer in the commit message. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Caroline, are you still working on this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |String patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210174|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
Devises et taux de change) --> There should be a column with the Archived currency translation
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 --- Comment #5 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 211887 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211887&action=edit Bug 43972: Add translation context for "Archived" This patch adds translation context for the word "Archived" when used alone so that it can be translated correctly depending on the context where it is used. Note: Context is only added where the word is visible in the interface. It is used in the debit and credit types tables, but it's a hidden table column. Adding context in this situation does not make much sense. Note: I consulted with ChatGPT (free version) while writing this and came across obstacles. Test plan: 1. Apply the patch 2. Install a new language koha-translate --install fr-CA --dev kohadev 3. Update the strings gulp po:update --lang fr-CA 4. In misc/translator/po/fr-CA-messages.po, there should be new entries for "Archived currency" and "Archived suggestion". Translate those as you wish (I used different translations just to make sure they were appearing in the correct places) and save msgctxt "Archived currency" msgid "Archived" msgstr "Devise archivée" msgctxt "Archived suggestion" msgid "Archived" msgstr "Suggestion archivée" 5. Apply the new strings to the templates ktd --root --shell koha-translate --update fr-CA --dev kohadev restart_all 6. Activate the new language in the StaffInterfaceLanguages 7. Switch the interface to the new language 8. Navigate to Administration > Currencies and exchange rates (Administration 9. Go to Suggestions 10. Click New purchase suggestion (Nouvelle suggestion d'achat) 11. Fill out the title and save 12. Check the box for the suggestion and click Archive (Archiver) 13. Check the box Include archived (Inclure les suggestions archivées) and search --> Under the suggestion there should be a note with the Archived suggestion translation -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211887|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
Devises et taux de change) --> There should be a column with the Archived currency translation
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 --- Comment #6 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 211888 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211888&action=edit Bug 43972: Add translation context for "Archived" This patch adds translation context for the word "Archived" when used alone so that it can be translated correctly depending on the context where it is used. Note: Context is only added where the word is visible in the interface. It is used in the debit and credit types tables, but it's a hidden table column. Adding context in this situation does not make much sense. Note: I consulted with ChatGPT (free version) while writing this and came across obstacles. Test plan: 1. Apply the patch 2. Install a new language koha-translate --install fr-CA --dev kohadev 3. Update the strings gulp po:update --lang fr-CA 4. In misc/translator/po/fr-CA-messages.po, there should be new entries for "Archived currency" and "Archived suggestion". Translate those as you wish (I used different translations just to make sure they were appearing in the correct places) and save msgctxt "Archived currency" msgid "Archived" msgstr "Devise archivée" msgctxt "Archived suggestion" msgid "Archived" msgstr "Suggestion archivée" 5. Apply the new strings to the templates ktd --root --shell koha-translate --update fr-CA --dev kohadev restart_all 6. Activate the new language in the StaffInterfaceLanguages 7. Switch the interface to the new language 8. Navigate to Administration > Currencies and exchange rates (Administration 9. Go to Suggestions 10. Click New purchase suggestion (Nouvelle suggestion d'achat) 11. Fill out the title and save 12. Check the box for the suggestion and click Archive (Archiver) 13. Check the box Include archived (Inclure les suggestions archivées) and search --> Under the suggestion there should be a note with the Archived suggestion translation fixup Bug 43972: Add translation context for "Archived" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43972 --- Comment #7 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- I tried following Jonathan's suggestions. - There is no more context for the hidden columns. The only context added is for the currencies table and for the archived suggestion note. - I used the code provided by Jonathan in comment #3 - I added a small note saying I consulted with ChatGPT in my hour of need :( - Test plan provided If anything is missing, let me know. Honestly, I had abandoned this a little bit because both terms that are visible are for feminine things in French and both terms that are hidden are for masculine things. So I simply translated the term as feminine in Weblate. @Katrin, are currencies and suggestions different genres in German? If so we can keep this, if not, then I'm not sure it's worth going through with this. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org