Bug 38727

Summary: Improve the translatability of the patron categories administration page
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: I18N/L10NAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to main --- QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: david, f.demians, jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This improves the translatability of the hint text for these fields on the patron categories form (Administration > Patrons and administration > Patron categories): - Block expired patron OPAC actions - Exclude from local holds priority - Checkout charge limit - Guarantees checkout charge limit - Guarantors with guarantees checkout charge limit
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 28924    
Bug Blocks:    
Attachments: Bug 38727: Improve translatability in categories.tt
Bug 38727: Improve translatability in categories.tt
Bug 38727: Improve translatability in categories.tt
Bug 38727: Improve translatability in categories.tt
Bug 38727: Add missing closing div

Description Tomás Cohen Arazi (tcohen) 2024-12-17 12:47:57 UTC
There are three strings that are more or less like this:

```
If set, this will override the global value set in the {preference} preference
```

They are built in a way that splits it into


* `If set, this will override the global value set in the`
* `preference`

At least in spanish, `preference` needs to be put in before `{preference}`:

`Si se define, tendrá precedencia sobre el valor global definido en la preferencia de sistema {preference}`

So (in the translation) we need to put a space or similar for `preference`. But it turns out this string is reused in many other places, so translating it correctly actually breaks translations in many places. I think (at least) other latin languages will suffer the same.

This is terrible and needs to get fixed.
Comment 1 Tomás Cohen Arazi (tcohen) 2024-12-17 13:00:50 UTC
Created attachment 175609 [details] [review]
Bug 38727: Improve translatability in categories.tt

This makes the strings easier to translated for maintaining them as a
whole instead of splitting them

Extra: it adds a missing dot for consistency.

To test:
1. In the categories edit page, check the 3 'If set...' texts
2. Apply this patch and reload
=> SUCCESS: No visual change
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Jonathan Druart 2024-12-17 13:10:42 UTC
You should escape the result of a translation.
Comment 3 Tomás Cohen Arazi (tcohen) 2024-12-17 14:27:10 UTC
Created attachment 175619 [details] [review]
Bug 38727: Improve translatability in categories.tt

This makes the strings easier to translated for maintaining them as a
whole instead of splitting them

Bonus 1: it adds a missing dot for consistency.
Bonus 2: makes a string more idiomatic.

To test:
1. In the categories edit page, check the 3 'If set...' texts
2. Apply this patch and reload
=> SUCCESS: No visual change
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi (tcohen) 2024-12-17 14:27:29 UTC
(In reply to Jonathan Druart from comment #2)
> You should escape the result of a translation.

Thanks for pointing me in that direction :-D
Comment 5 David Nind 2025-01-02 23:22:07 UTC
Created attachment 176107 [details] [review]
Bug 38727: Improve translatability in categories.tt

This makes the strings easier to translated for maintaining them as a
whole instead of splitting them

Bonus 1: it adds a missing dot for consistency.
Bonus 2: makes a string more idiomatic.

To test:
1. In the categories edit page, check the 3 'If set...' texts
2. Apply this patch and reload
=> SUCCESS: No visual change
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Jonathan Druart 2025-01-16 15:24:47 UTC
Still this one is ugly:

msgid ", holds placed by patrons of this category will not be given priority."

Because of the "If <i>Yes</i>"
Comment 7 Jonathan Druart 2025-01-16 15:25:59 UTC
Created attachment 176675 [details] [review]
Bug 38727: Improve translatability in categories.tt

This makes the strings easier to translated for maintaining them as a
whole instead of splitting them

Bonus 1: it adds a missing dot for consistency.
Bonus 2: makes a string more idiomatic.

To test:
1. In the categories edit page, check the 3 'If set...' texts
2. Apply this patch and reload
=> SUCCESS: No visual change
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2025-01-16 15:26:02 UTC
Created attachment 176676 [details] [review]
Bug 38727: Add missing closing div

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Katrin Fischer 2025-01-16 16:42:15 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 10 David Nind 2025-02-04 03:29:11 UTC
Did some patches get lost here?

For adding the release note, it only looks like the "Block expired patron OPAC actions" field hint text is changed.

The patch mentions other text was changed, and obsoleted patches have some changes to the "If set, ...." and other hint text.
Comment 11 Tomás Cohen Arazi (tcohen) 2025-02-04 12:54:26 UTC
(In reply to David Nind from comment #10)
> Did some patches get lost here?
> 
> For adding the release note, it only looks like the "Block expired patron
> OPAC actions" field hint text is changed.
> 
> The patch mentions other text was changed, and obsoleted patches have some
> changes to the "If set, ...." and other hint text.

I see the two patches in main:

```shell
tig log 7cb370904b4c6ee0abf13db85b6893b6eeca6793
tig log aff29616abc3a791c3b3ccf656313c77e21b19db
```
Comment 12 David Nind 2025-02-08 23:29:05 UTC
(In reply to Tomás Cohen Arazi (tcohen) from comment #11)
> (In reply to David Nind from comment #10)
> > Did some patches get lost here?
> > 
> > For adding the release note, it only looks like the "Block expired patron
> > OPAC actions" field hint text is changed.
> > 
> > The patch mentions other text was changed, and obsoleted patches have some
> > changes to the "If set, ...." and other hint text.
> 
> I see the two patches in main:
> 
> ```shell
> tig log 7cb370904b4c6ee0abf13db85b6893b6eeca6793
> tig log aff29616abc3a791c3b3ccf656313c77e21b19db
> ```

Not sure what I was thinking/seeing. Everything looks OK now that I've looked at it again!