From 70b4f0970125c03f6ec4dd20c3974a82d5883d1e Mon Sep 17 00:00:00 2001 From: Caroline Cyr La Rose Date: Mon, 10 Jul 2023 10:52:35 -0400 Subject: [PATCH] Bug 34228: Add translation context to "Managed by" This patch adds context for translators to the Managed by string when it applies to acquisitions baskets (as opposed to purchase suggestions). To test: 0. If you don't already have acquisitions set up, create a budget and a vendor 1. Apply patch 2. Create a basket 2.1. Go to Acquisitions 2.2. Search for a vendor 2.3. Click New > Basket 2.4. Fill out the form 2.5. Click Save 3. View the basket details page --> The page works (no errors) --> 'Managed by:' is displayed on the right, no spelling errors 4. Click Add to basket > From a new (empty) record --> The page works (no errors) --> 'Managed by:' is displayed under Basket details, no spelling errors 5. Click Cancel 6. Update the po files gulp po:update --lang xx-XX for example, gulp po:update --lang fr-CA 7. Check the xx-XX-messages.po file (e.g. misc/translator/po/fr-CA-messages.po) --> There should be an entry for 'Managed by:' with a line msgctxt that gives the 'Acquisitions basket managed by user' context 8. Update the file with a random phrase for the 'Managed by:' translation for example, I translated 'Managed by:' by 'AAAAAAA:', just to see the difference \#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt:308 \#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt:281 msgctxt "Acquisitions basket managed by user" msgid "Managed by:" msgstr "AAAAAAA:" 9. Install a new language 9.1. Run the following commands in the terminal, replacing xx-XX with the language code (e.g. fr-CA) ./misc/translator/translate install xx-XX 9.2. In the Koha staff interface, go to Administration > System preferences 9.3. Search for language 9.4. Check the box next to the new language 9.5. Save 10. Switch the language of the interface 11. Redo steps 3 and 4 --> The pages still work (no errors) --> The 'Managed by:' string should be replaced by whatever you put in step 8 Optional test 12. In the staff interface in English, view one or more of these pages, the 'Managed by' string should be unchanged - Acquisitions > Suggestions (Managed by column heading) - Acquisitions > Suggestions (Organize by: Managed by sorting option) - Acquisitions > Suggestions (Filter by: Suggestion information: Managed by filter option) - Acquisitions > Suggestions > Click on a suggestion (Managed by table row under Suggestion management) - Patrons > Patron account > Purchase suggestions (Managed by column heading) 13. View these same pages in the other language, the Managed by string should NOT be changed to whatever you put in step 8 Signed-off-by: Lucas Gass Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 69acd9f1cc..f79f8896f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -309,7 +309,7 @@
  1. - Managed by: + [% tp('Acquisitions basket managed by user', 'Managed by:') | html %]
      [% FOREACH user IN users %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index 4523300a8d..7e2fa8d653 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -287,7 +287,7 @@
    • Contract number: [% basketcontractno | html %]
    • Contract name: [% basketcontractname | html %]
    • [% END %] - [% IF ( authorisedbyname ) %]
    • Managed by: [% authorisedbyname | html %]
    • [% END %] + [% IF ( authorisedbyname ) %]
    • [% tp('Acquisitions basket managed by user', 'Managed by:') | html %] [% authorisedbyname | html %]
    • [% END %] [% IF ( creationdate ) %]
    • Open on: [% creationdate | $KohaDates %]
    • [% END %] [% IF ( closedate ) %] -- 2.39.5