From 15889645211c2899dfd5fadf7ba9cdfe576483b9 Mon Sep 17 00:00:00 2001 From: Caroline Cyr La Rose Date: Mon, 10 Jul 2023 17:04:57 -0400 Subject: [PATCH] Bug 31736: Context for translation: 'All' (All patron categories) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds context for translators for the term 'All' when it refers to 'All patron categories'. 1. Apply patch 2. View the following pages --> The pages work (no errors) --> No spelling errors in 'All' patron categories - Administration > Circulation and fines rules > Patron category column (All in existing rule) - Administration > Circulation and fines rules > Patron category column (All in drop-down to create a new rule) - Administration > Circulation and fines rules > Default waiting hold cancellation policy > Patron category column (All in existing rule) - Administration > Circulation and fines rules > Default waiting hold cancellation policy > Patron category column (All in drop-down to create a new rule) - Administration > Circulation and fines rules > Default article request fees > Patron category column (All in existing rule) - Administration > Circulation and fines rules > Default article request fees > Patron category column (All in drop-down to create a new rule) - Installer > Onboarding > New circulation rule (Patron category) 3. Update the po files gulp po:update --lang xx-XX for example, gulp po:update --lang fr-CA 4. Check the xx-XX-messages.po file (e.g. misc/translator/po/fr-CA-messages.po) --> There should be an entry for 'All' with a line msgctxt that gives the 'All patron categories' context 5. Update the file with a random word or phrase for the 'All' translation For example, I translated 'All' by "Toutes les catégories d'utilisateurs" \#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt:215 \#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt:406 \#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt:892 \#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt:921 \#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt:1027 \#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt:1048 \#: koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt:75 msgctxt "All patron categories" msgid "All" msgstr "Toutes les catégories d'utilisateurs" 6. Install a new language 6.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 6.2. In the Koha staff interface, go to Administration > System preferences 6.3. Search for language 6.4. Check the box next to the new language 6.5. Save 7. Switch the language of the interface 8. Redo step 2 --> The pages still work (no errors) --> The 'All' patron categories string should be replaced by whatever you put in step 5 --- .../prog/en/modules/admin/smart-rules.tt | 13 +++++++------ .../prog/en/modules/onboarding/onboardingstep5.tt | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index eb6a60b362..605156e8ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -7,6 +7,7 @@ [% USE ItemTypes %] [% USE CirculationRules %] [% USE Price %] +[% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% SET branchcode = humanbranch || undef %] @@ -211,7 +212,7 @@ [% END %] [% IF c == undef %] - All + [% tp('All patron categories', 'All') | html %] [% ELSE %] [% Categories.GetName(c) | html %] [% END %] @@ -402,7 +403,7 @@ 2 - + [% FOREACH patron_category IN patron_categories %] [% END %] @@ -1023,7 +1024,7 @@ [% IF c == '*' %] - All + [% tp('All patron categories', 'All') | html %] [% ELSE %] [% Categories.GetName(c) | html %] [% END %] @@ -1044,7 +1045,7 @@ - + [% FOREACH category IN categories %] [%END%] -- 2.34.1