Bug 31957 - Translation: Ability to change the sentence structure on library administration page
Summary: Translation: Ability to change the sentence structure on library administrati...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-24 18:36 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:42 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.03,22.05.11, 21.11.19


Attachments
Bug 31957: Improve translatability of text containing links on libraries admin page (5.35 KB, patch)
2023-01-06 22:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31957: Improve translatability of text containing links on libraries admin page (5.13 KB, patch)
2023-01-06 22:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31957: (follow-up) Further improve translations (5.06 KB, patch)
2023-01-09 20:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31957: Improve translatability of text containing links on libraries admin page (5.13 KB, patch)
2023-01-09 20:06 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31957: (follow-up) Further improve translations (5.06 KB, patch)
2023-01-09 20:06 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31957: Improve translatability of text containing links on libraries admin page (5.20 KB, patch)
2023-01-09 20:47 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 31957: (follow-up) Further improve translations (5.13 KB, patch)
2023-01-09 20:47 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 31957: Improve translatability of text containing links on libraries admin page (5.26 KB, patch)
2023-02-10 19:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 31957: (follow-up) Further improve translations (5.18 KB, patch)
2023-02-10 19:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 31957: (QA follow-up) Add missing filters (3.55 KB, patch)
2023-02-15 12:33 UTC, Tomás Cohen Arazi
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 2022-10-24 18:36:39 UTC
I'm having trouble translating the sentences in branches.tt where it says the the default is a system preference.

For example, line ~210

[% 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
                        [% ELSE %]
                            Default: ILLDefaultStaffEmail system preference
                        [% END %]

It comes out like this in translation

msgid "%s Default: "

msgid "ILLDefaultStaffEmail"

msgid ""
"system preference %s Default: ILLDefaultStaffEmail system preference %s "


However, in French, the order of the words should be inverted, e.g. ILLDefaultStaffEmail system preference becomes system preference ILLDefaultStaffEmail.

Can we modify the tt so that we get the whole sentence, or a %s that we can play with to change the order of the words?
Comment 1 Katrin Fischer 2023-01-06 22:54:36 UTC
Created attachment 145112 [details] [review]
Bug 31957: Improve translatability of text containing links on libraries admin page

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
Comment 2 Katrin Fischer 2023-01-06 22:58:42 UTC
Created attachment 145113 [details] [review]
Bug 31957: Improve translatability of text containing links on libraries admin page

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
Comment 3 Caroline Cyr La Rose 2023-01-09 17:08:17 UTC
Hi Katrin! Thanks for looking at this one!

I tested and it works well. However, it does add unnecessary strings in the .po file, such as 

#. %1$s:  IF ( CAN_user_parameters_manage_sysprefs ) 
#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt:194
#, fuzzy, c-format
msgid "%s [%% SET pref_ILLDefaultStaffEmail_link = '"
msgstr "%s %s [%% SET pref_MARCOverlayRules_link = '"

(ignore the msgstr, i's obviously wrong hehe!)

I tried to remove the patch and reupdate the files and these lines disappear, so it's definitely the patch that adds them.

I tried adding spans to indicate the limits of the translatable string, but it doesn't remove the SET blabla lines from the po file.

Caroline
Comment 4 Katrin Fischer 2023-01-09 17:45:18 UTC
I saw these extra strings, but I am not sure if we can avoid them. You might have to pick your poison... I copied this solution from something Jonathan did for Curbside pickups, not sure if there is any other way right now.

And this one is not from this patch set:

msgstr "%s %s [%% SET pref_MARCOverlayRules_link = '"
Comment 5 Caroline Cyr La Rose 2023-01-09 17:55:28 UTC
I can't find the bug, but I'm pretty sure Frido did something to remove TT comments from translatable strings in one bug I had...

I found bug 18682 but it's not the same I remember.
Comment 6 Katrin Fischer 2023-01-09 19:18:05 UTC
(In reply to Caroline Cyr La Rose from comment #5)
> I can't find the bug, but I'm pretty sure Frido did something to remove TT
> comments from translatable strings in one bug I had...
> 
> I found bug 18682 but it's not the same I remember.

Good thinking, maybe Frido can help!
Comment 7 Katrin Fischer 2023-01-09 20:01:59 UTC
Created attachment 145161 [details] [review]
Bug 31957: (follow-up) Further improve translations

With the previous attempt, we ended up with some TT
constructs in the po files. This will hopefully avoid that.
Comment 8 Katrin Fischer 2023-01-09 20:06:12 UTC
Created attachment 145162 [details] [review]
Bug 31957: Improve translatability of text containing links on libraries admin page

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
Comment 9 Katrin Fischer 2023-01-09 20:06:17 UTC
Created attachment 145163 [details] [review]
Bug 31957: (follow-up) Further improve translations

With the previous attempt, we ended up with some TT
constructs in the po files. This will hopefully avoid that.
Comment 10 Caroline Cyr La Rose 2023-01-09 20:47:27 UTC
Created attachment 145164 [details] [review]
Bug 31957: Improve translatability of text containing links on libraries admin page

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>
Comment 11 Caroline Cyr La Rose 2023-01-09 20:47:31 UTC
Created attachment 145165 [details] [review]
Bug 31957: (follow-up) Further improve translations

With the previous attempt, we ended up with some TT
constructs in the po files. This will hopefully avoid that.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 12 Kyle M Hall 2023-02-10 19:33:07 UTC
Created attachment 146513 [details] [review]
Bug 31957: Improve translatability of text containing links on libraries admin page

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>
Comment 13 Kyle M Hall 2023-02-10 19:33:15 UTC
Created attachment 146514 [details] [review]
Bug 31957: (follow-up) Further improve translations

With the previous attempt, we ended up with some TT
constructs in the po files. This will hopefully avoid that.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 14 Tomás Cohen Arazi 2023-02-15 12:33:15 UTC
Created attachment 146688 [details] [review]
Bug 31957: (QA follow-up) Add missing filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi 2023-02-15 12:34:31 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 16 Pedro Amorim 2023-02-16 10:14:50 UTC
Nice work everyone!

Pushed to 22.11.x for next release
Comment 17 Lucas Gass 2023-03-01 13:48:01 UTC
Backported to 22.05.x for upcoming 22.05.11
Comment 18 Arthur Suzuki 2023-03-29 07:56:53 UTC
applied to 21.11.x for upcoming 21.11.19
Comment 19 wainuiwitikapark 2023-04-27 03:50:25 UTC
Not backporting to 21.05.x