Bug 31957: Improve translatability of text containing links on libraries admin page
authorKatrin Fischer <katrin.fischer.83@web.de>
Fri, 6 Jan 2023 22:33:43 +0000 (22:33 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 15 Feb 2023 12:09:07 +0000 (09:09 -0300)
The libraries administration page has several links to system
preferences that appear within sentences or with other text
around it. To make translations easier, we need to make sure that
those links don't break context.

To test:
* Activate IllModule (so we can see the ILL staff email setting)
* Go to administration > libraries
* Verify that the links for those settings show correctly
  * Reply-to
  * Return-Path
  * Ill staff email
  * MARC organization code
* Apply patch
* Verify links still work and show unchanged

If you are familiar with the process, you can also make sure
the strings now show up on po files as expected:
https://wiki.koha-community.org/wiki/Translating_Koha#Updating_the_po_files_in_your_installation

https://bugs.koha-community.org/show_bug.cgi?id=31954

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt

index 39b66c0..25e3910 100644 (file)
@@ -193,7 +193,8 @@ Libraries &rsaquo; Administration &rsaquo; Koha
                     <input type="text" name="branchillemail" id="branchillemail" class="email"  size="80" value="[% library.branchillemail | html %]" />
                     <div class="hint">
                         [% IF ( CAN_user_parameters_manage_sysprefs ) %]
-                            Default: <a target="_blank" href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLDefaultStaffEmail">ILLDefaultStaffEmail</a> system preference
+                            [% SET pref_ILLDefaultStaffEmail_link = '<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILLDefaultStaffEmail">ILLDefaultStaffEmail</a>' %]
+                            Default: [% pref_ILLDefaultStaffEmail_link | $raw %] system preference
                         [% ELSE %]
                             Default: ILLDefaultStaffEmail system preference
                         [% END %]
@@ -205,7 +206,8 @@ Libraries &rsaquo; Administration &rsaquo; Koha
                     <input type="text" name="branchreplyto" id="branchreplyto" class="email"  size="80" value="[% library.branchreplyto | html %]" />
                     <div class="hint">
                          [% IF ( CAN_user_parameters_manage_sysprefs ) %]
-                            Default: <a target="_blank" href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ReplyToDefault">ReplyToDefault</a> system preference
+                            [% SET pref_ReplyToDefault_link = '<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReplyToDefault">ReplyToDefault</a>' %]
+                            Default: [% pref_ReplyToDefault_link | $raw %] system preference
                         [% ELSE %]
                             Default: ReplyToDefault system preference
                         [% END %]
@@ -216,7 +218,8 @@ Libraries &rsaquo; Administration &rsaquo; Koha
                     <input type="text" name="branchreturnpath" id="branchreturnpath" class="email"  size="80" value="[% library.branchreturnpath | html %]" />
                     <div class="hint">
                          [% IF ( CAN_user_parameters_manage_sysprefs ) %]
-                            Default: <a target="_blank" href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ReturnpathDefault">ReturnpathDefault</a> system preference
+                            [% SET pref_ReturnpathDefault_link = '<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReturnpathDefault">ReturnpathDefault</a>' %]
+                            Default: [% pref_ReturnpathDefault_link | $raw %] system preference
                         [% ELSE %]
                             Default: ReturnpathDefault system preference
                         [% END %]
@@ -257,7 +260,8 @@ Libraries &rsaquo; Administration &rsaquo; Koha
                     <input type="text" name="marcorgcode" id="marcorgcode" size="16" maxlength="16" value="[% library.marcorgcode | html %]" />
                     <div class="hint">
                         [% IF ( CAN_user_parameters_manage_sysprefs ) %]
-                            If not filled in defaults to system preference <a target="_blank" href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=MARCOrgCode">MARCOrgCode</a>.
+                            [% SET pref_MARCOrgCode_link = '<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=MARCOrgCode">MARCOrgCode</a>' %]
+                            If not filled in defaults to system preference [% pref_MARCOrgCode_link | $raw %].
                         [% ELSE %]
                             If not filled in defaults to system preference MARCOrgCode.
                         [% END %]