Bug 34228 - Add translation context to "Managed by"
Summary: Add translation context to "Managed by"
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Caroline Cyr La Rose
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-07 14:24 UTC by Caroline Cyr La Rose
Modified: 2023-10-14 12:29 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: String patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00


Attachments
Bug 34228: Add translation context to "Managed by" (5.60 KB, patch)
2023-07-10 14:55 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 34228: Add translation context to "Managed by" (5.66 KB, patch)
2023-07-10 15:25 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 34228: Add translation context to "Managed by" (5.39 KB, patch)
2023-09-15 09:43 UTC, Marcel de Rooy
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-07-07 14:24:31 UTC
"Managed by" is used for both basket and purchase suggestions.

In french, those two things have different genders, so "managed" is written differently.
Comment 1 Caroline Cyr La Rose 2023-07-10 14:55:15 UTC
Created attachment 153282 [details] [review]
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
Comment 2 Lucas Gass 2023-07-10 15:25:42 UTC
Created attachment 153284 [details] [review]
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 <lucas@bywatersolutions.com>
Comment 3 Marcel de Rooy 2023-09-15 09:43:00 UTC
Created attachment 155655 [details] [review]
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 <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Tomás Cohen Arazi 2023-09-15 14:58:38 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-09-18 08:08:33 UTC
Enhancement not pushed to 23.05.x