Bug 34834 - Add translation context for "Order"
Summary: Add translation context for "Order"
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Caroline Cyr La Rose
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-19 20:12 UTC by Caroline Cyr La Rose
Modified: 2024-07-04 20:37 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch adds context for translators for the word Order, as it is sometimes used as a verb (e.g. to order) and a noun (e.g. an order).
Version(s) released in:
23.11.00
Circulation function:


Attachments
Bug 34834: Add translation context for "Order" (5.19 KB, patch)
2023-09-20 14:27 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 34834: Add translation context for "Order" (5.26 KB, patch)
2023-09-20 16:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34834: Add translation context for "Order" (5.32 KB, patch)
2023-10-31 15:34 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2023-09-19 20:12:21 UTC
In bug 23983, I added context in acquisitions for "Order" (verb - to order) vs "Order" (noun - an order). Since then, there have been a few additions of "Order" and those don't have the translation context.

For example, in fr-CA-staff-prog.po

#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt:91
#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt:349
#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt:212
#: koha-tmpl/intranet-tmpl/prog/en/includes/str/tinymce_i18n.inc:2
#, c-format
msgid "Order"
msgstr "Commander"


They should have the context

Order (verb)
#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt:212

Order (noun)
#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt:91
#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt:349

?? (I was not able to find it in the staff interface, but I suspect it's the verb "order" in the sense of "sorting" rather than the acquisition meaning)
#: koha-tmpl/intranet-tmpl/prog/en/includes/str/tinymce_i18n.inc:2



To get to each:

- orderreceive: when receiving multiple orders, the table heading

- parcel: when receiving an order, there is a "View" menu with "Order", "MARC", etc.

- z3950_search: when adding an order from an external source, if you hover the mouse on the Order option, there is a thing that opens (a tooltip?) with the word "Order"
Comment 1 Caroline Cyr La Rose 2023-09-20 14:27:58 UTC
Created attachment 155948 [details] [review]
Bug 34834: Add translation context for "Order"

This patch adds context for translation to the term "Order". It is
sometimes used as a verb (e.g. to order) and sometimes as a noun (e.g.
an order).

To test:
1. Go to the various pages and make sure Order appears correctly in
   English

   -  orderreceive: when receiving multiple orders, the table heading

   -  parcel: when receiving an order, there is a "View" menu with "Order", "MARC", and "Card"

   -  z3950_search: when adding an order from an external source, if you hover the mouse on the Order option, there is a thing that opens (a tooltip?) with the word "Order"

2. Apply patch

3. Redo step 1 in English, make sure the pages still work

4. Update the translation files

   gulp po:update --lang fr-CA

5. View the messages.po file and make sure the term is translated for both verb and noun context (you can put anything, just something different to tell them apart)

6. View the pages in the other language, the terms should be

   -  orderreceive: noun

   -  parcel: noun

   -  z3950_search: verb
Comment 2 Caroline Cyr La Rose 2023-09-20 15:41:31 UTC
I tried using the _p() and __p() syntax in parcel.tt and I can't get it to work.

I change the line to either 

result += '<li><a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + encodeURIComponent(row.order_id) + '" class="previewData">' + _p("noun","Order") + '</a></li>';

or

result += '<li><a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + encodeURIComponent(row.order_id) + '" class="previewData">' + __p("noun","Order") + '</a></li>';

and run gulp po:update --lang fr-CA

The word is not in either messages.po or messages-js.po

What am I doing wrong?

In the mean time, I changed the file for Owen's solution of putting the text between the opening and closing tags like <a>text</a> rather than inside the opening tag. This works well, the page loads, the word is in the po files and the translation is applied.

The one in parcel.tt is the most annoying one of the three tbh, so I'd really like it to be fixed.
Comment 3 Owen Leonard 2023-09-20 16:55:04 UTC
Created attachment 155955 [details] [review]
Bug 34834: Add translation context for "Order"

This patch adds context for translation to the term "Order". It is
sometimes used as a verb (e.g. to order) and sometimes as a noun (e.g.
an order).

To test:
1. Go to the various pages and make sure Order appears correctly in
   English

   -  orderreceive: when receiving multiple orders, the table heading
   -  parcel: when receiving an order, there is a "View" menu with
      "Order", "MARC", and "Card"
   -  z3950_search: when adding an order from an external source, if
      you hover the mouse on the Order option, there is a thing that
      opens (a tooltip?) with the word "Order"

2. Apply patch

3. Redo step 1 in English, make sure the pages still work

4. Update the translation files

   gulp po:update --lang fr-CA

5. View the messages.po file and make sure the term is translated for
   both verb and noun context (you can put anything, just something
   different to tell them apart)

6. View the pages in the other language, the terms should be

   -  orderreceive: noun
   -  parcel: noun
   -  z3950_search: verb

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Katrin Fischer 2023-10-31 15:34:55 UTC
Created attachment 158139 [details] [review]
Bug 34834: Add translation context for "Order"

This patch adds context for translation to the term "Order". It is
sometimes used as a verb (e.g. to order) and sometimes as a noun (e.g.
an order).

To test:
1. Go to the various pages and make sure Order appears correctly in
   English

   -  orderreceive: when receiving multiple orders, the table heading
   -  parcel: when receiving an order, there is a "View" menu with
      "Order", "MARC", and "Card"
   -  z3950_search: when adding an order from an external source, if
      you hover the mouse on the Order option, there is a thing that
      opens (a tooltip?) with the word "Order"

2. Apply patch

3. Redo step 1 in English, make sure the pages still work

4. Update the translation files

   gulp po:update --lang fr-CA

5. View the messages.po file and make sure the term is translated for
   both verb and noun context (you can put anything, just something
   different to tell them apart)

6. View the pages in the other language, the terms should be

   -  orderreceive: noun
   -  parcel: noun
   -  z3950_search: verb

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi (tcohen) 2023-11-01 20:26:50 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-11-08 08:46:43 UTC
Enhancement not pushed to 23.05.x