Bug 31718 - Change the IF ELSE values in MARC subfields structure breadcrumbs to facilitate translation
Summary: Change the IF ELSE values in MARC subfields structure breadcrumbs to facilita...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Caroline Cyr La Rose
QA Contact: Katrin Fischer
URL:
Keywords: Academy
Depends on: 30733
Blocks:
  Show dependency treegraph
 
Reported: 2022-10-07 20:32 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement changes the strings in the IF ELSE for the framework name in the breadcrumbs on the marc_subfields_structure.pl page. There is no change to the page in English. However, it will facilitate the translation by having complete strings.
Version(s) released in:
22.11.00


Attachments
Bug 31718: Change the IF ELSE values in marc_subfields_structure breadcrumbs to facilitate translation (2.05 KB, patch)
2022-10-07 20:54 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 31718: Others facilitate translation in frameworks administration (7.22 KB, patch)
2022-10-08 01:44 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 31718: Change the IF ELSE values in marc_subfields_structure breadcrumbs to facilitate translation (2.09 KB, patch)
2022-10-09 21:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 31718: Others facilitate translation in frameworks administration (7.26 KB, patch)
2022-10-09 21:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 31718: Change the IF ELSE values in marc_subfields_structure breadcrumbs to facilitate translation (2.15 KB, patch)
2022-10-15 17:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31718: Others facilitate translation in frameworks administration (7.32 KB, patch)
2022-10-15 17:31 UTC, Katrin Fischer
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-07 20:32:00 UTC
This section of the breadcrumb in marc_subfields_structure.tt controls if it says we are in the default framework structure or the XYZ framework structure.

                    [% IF ( frameworkcode ) %]
                        [% frameworkcode | html %]
                    [% ELSE %]
                        <span>Default</span>
                    [% END %] <span>framework structure</span>

Before bug 29602, the string to translate looked like this

%s %s %s Default %s framework structure 

Now, the 'Default' and the 'framework structure' are two different strings.

However, in French, the correct syntax is 'framework structure default'. Before bug 29602, we could play around with the %s to accomodate the different syntax structure. 

Since the option to move the %s was removed, I propose we write the whole phrase 'Default framework structure' or 'XYZ framework structure' in the IF ELSE.
Comment 1 Caroline Cyr La Rose 2022-10-07 20:36:29 UTC
Something like 

[% IF ( frameworkcode ) %]
    [% frameworkcode | html %] <span>framework structure</span>
[% ELSE %]
    <span>Default framework structure</span>
[% END %]
Comment 2 Caroline Cyr La Rose 2022-10-07 20:43:35 UTC
(In reply to Caroline Cyr La Rose from comment #1)
> Something like 
> 
> [% IF ( frameworkcode ) %]
>     [% frameworkcode | html %] <span>framework structure</span>
> [% ELSE %]
>     <span>Default framework structure</span>
> [% END %]

The span needs to be around the [% frameworkcode | html %] part so that we can move it around in the string.

     <span>[% frameworkcode | html %] framework structure</span>
Comment 3 Caroline Cyr La Rose 2022-10-07 20:54:42 UTC
Created attachment 141526 [details] [review]
Bug 31718: Change the IF ELSE values in marc_subfields_structure breadcrumbs to facilitate translation

This patch changes the strings in the IF ELSE for the framework
name in the breadcrumbs on the marc_subfields_structure.pl page.

To test:
1) Apply patch
2) In the intranet, go to Administration > MARC bibliographic framework
3) Click 'Actions' next to the default framework and choose 'MARC
structure'
4) Click 'Actions' next to a MARC tag and choose 'View subfields'
5) Check the breadcrumbs, they should show
Home > Administration > MARC frameworks > Default framework structure >
...
6) Redo steps 2-5, using a different framework, e.g. ACQ
The breadcrumbs for ACQ should look like
Home > Administration > MARC frameworks > ACQ framework structure > ...
Comment 4 Caroline Cyr La Rose 2022-10-07 21:06:40 UTC
For Release Maintainers, this is needed as far back as 22.05. Before that it's not needed.

For translators, the two strings will now be

Default framework structure

and

%s framework structure


In French, the translations will be

Structure de la grille par défaut

and

Structure de la grille %s
Comment 5 Fridolin Somers 2022-10-08 01:44:25 UTC
Created attachment 141536 [details] [review]
Bug 31718: Others facilitate translation in frameworks administration

Some other IF/ELSE/END can be changed to facilitate translation

Test plan :
Always test with default framework and with another framework and
compare with and without patch
1) View subfields of field
=> Check the h1 in page
2) Perform actions on a field (create, modify, delete)
=> Check breadcrumbs and h1 in page
3) View the framework table
=> Check columns Repeatable, Mandatory, Important
Comment 6 Fridolin Somers 2022-10-08 01:45:55 UTC
I signed first patch and added a new one for some other IF/ELSE/END that can facilitate translation.
Like did Bug 30733
Comment 7 David Nind 2022-10-09 21:00:46 UTC
Created attachment 141556 [details] [review]
Bug 31718: Change the IF ELSE values in marc_subfields_structure breadcrumbs to facilitate translation

This patch changes the strings in the IF ELSE for the framework
name in the breadcrumbs on the marc_subfields_structure.pl page.

To test:
1) Apply patch
2) In the intranet, go to Administration > MARC bibliographic framework
3) Click 'Actions' next to the default framework and choose 'MARC
structure'
4) Click 'Actions' next to a MARC tag and choose 'View subfields'
5) Check the breadcrumbs, they should show
Home > Administration > MARC frameworks > Default framework structure >
...
6) Redo steps 2-5, using a different framework, e.g. ACQ
The breadcrumbs for ACQ should look like
Home > Administration > MARC frameworks > ACQ framework structure > ...

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2022-10-09 21:00:51 UTC
Created attachment 141557 [details] [review]
Bug 31718: Others facilitate translation in frameworks administration

Some other IF/ELSE/END can be changed to facilitate translation

Test plan :
Always test with default framework and with another framework and
compare with and without patch
1) View subfields of field
=> Check the h1 in page
2) Perform actions on a field (create, modify, delete)
=> Check breadcrumbs and h1 in page
3) View the framework table
=> Check columns Repeatable, Mandatory, Important

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2022-10-09 21:39:19 UTC
Testing notes (using KTD)
-------------------------

I checked the default framework and the BKS framework.

First patch - breadcrumbs when viewing and editing subfields (changes to a single span tag for the framework name):
- View the page source
- Search for breadcrumbs
- Before the patch is applied - default framework:
  <span>Default</span>
  <span>framework structure</span>
- After the patch is applied - default framework:
   <span>Default framework structure</span>
- Before the patch is applied - BKS framework:
    BKS
  <span>framework structure</span>
- After the patch is applied - BKS framework:
   <span>BKS framework structure</span>

Second patch - step 1 - view subfields:
- View the page source
- Search for <h1>
- No change to output for h1 before and after the patch is applied:
  . Default framework: <h1>MARC subfield structure admin for 245 (default framework)</h1>
  . BKS framework: <h1>MARC subfield structure admin for 245 (framework BKS)</h1>
  . Updates code for template so that it is consistent with other changes (I think)
- Breadcrumbs: changes as per the first patch

Second patch - step 2 - add, edit and delete a MARC tag:
- View the page source
- Search for breadcrumbs
- After patch is applied: <span> tags added to breadcrumbs where required

Second patch - step 3: Framework table:
- View the page source
- Search for Repeatable
- Check the first row of results:
  ==> should now have <span> tags around all the Nos and Yeses

I also noticed that when deleting a tag from the view subfields page that there is an 'i' added to the breadcrumb, for example:
- Home > Administration > MARC frameworks > BKS framework structure > Tag 245 Subfield structure > Confirm deletion of subfield ci
- Should be ... Confirm deletion of subfield c

I've created bug 31724 for this.
Comment 10 Katrin Fischer 2022-10-15 17:31:08 UTC
Created attachment 141924 [details] [review]
Bug 31718: Change the IF ELSE values in marc_subfields_structure breadcrumbs to facilitate translation

This patch changes the strings in the IF ELSE for the framework
name in the breadcrumbs on the marc_subfields_structure.pl page.

To test:
1) Apply patch
2) In the intranet, go to Administration > MARC bibliographic framework
3) Click 'Actions' next to the default framework and choose 'MARC
structure'
4) Click 'Actions' next to a MARC tag and choose 'View subfields'
5) Check the breadcrumbs, they should show
Home > Administration > MARC frameworks > Default framework structure >
...
6) Redo steps 2-5, using a different framework, e.g. ACQ
The breadcrumbs for ACQ should look like
Home > Administration > MARC frameworks > ACQ framework structure > ...

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2022-10-15 17:31:13 UTC
Created attachment 141925 [details] [review]
Bug 31718: Others facilitate translation in frameworks administration

Some other IF/ELSE/END can be changed to facilitate translation

Test plan :
Always test with default framework and with another framework and
compare with and without patch
1) View subfields of field
=> Check the h1 in page
2) Perform actions on a field (create, modify, delete)
=> Check breadcrumbs and h1 in page
3) View the framework table
=> Check columns Repeatable, Mandatory, Important

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Caroline Cyr La Rose 2022-10-17 13:29:28 UTC
Release maintainers, this is needed as far back as 22.05, but not before that. Thanks!
Comment 13 Victor Grousset/tuxayo 2022-10-18 00:16:28 UTC
Thanks for the fix Caroline! In 30733 I used the same trick in a few places where I noticed it would be an issue. I hope librarians aren't too unhappy with this missed case ^^

> Release maintainers, this is needed as far back as 22.05, but not before that.

Good that you repeat, because RMaints are unlikely to read all the comment history.
But don't worry, having bug 30733 in the "Depends on" field here takes care of ensuring that it's not backported too far. Also the way it will conflict when trying to backport would give a hint that it's missing a dependency.
Comment 14 Tomás Cohen Arazi 2022-10-24 14:45:47 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 15 Caroline Cyr La Rose 2022-10-24 15:10:14 UTC
(In reply to Victor Grousset/tuxayo from comment #13)
 
> > Release maintainers, this is needed as far back as 22.05, but not before that.
> 
> Good that you repeat, because RMaints are unlikely to read all the comment
> history.
> But don't worry, having bug 30733 in the "Depends on" field here takes care
> of ensuring that it's not backported too far. Also the way it will conflict
> when trying to backport would give a hint that it's missing a dependency.

I mainly wanted to let Lucas know that it was important to add it in 22.05 and not skip it :) After that, I figured it wouldn't apply...
Comment 16 Victor Grousset/tuxayo 2022-11-02 01:37:09 UTC
> After that, I figured it wouldn't apply...

It depends on the conflicts, if they are simple, Lucas will be able to solve them. Otherwise they will call for a backported patch here if someone needs it. You might then need to ask your dev colleagues to try to backport it and solve the conflict if you really need it.