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"
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
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.
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>
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>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x