Bug 38684 - Improve translatability in cat-toolbar.inc
Summary: Improve translatability in cat-toolbar.inc
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Katrin Fischer
URL:
Keywords: additional_work_needed
Depends on:
Blocks:
 
Reported: 2024-12-12 11:24 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2025-01-10 22:25 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 improves the translatability of the tool tips for 'Edit > Delete record' on the record details page in the staff interface. It makes it easier to translate the singular and plural forms of items and subscriptions.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38684: Improve translatability in cat-toolbar.inc (3.08 KB, patch)
2024-12-12 11:32 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 38684: Improve translatability in cat-toolbar.inc (3.14 KB, patch)
2024-12-13 18:01 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38684: FIX2 Fix koha-translate (2.61 KB, patch)
2025-01-01 20:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38684: FIX1 Fix koha-translate (2.47 KB, patch)
2025-01-01 20:28 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2024-12-12 11:24:58 UTC
There are two strings that could use `I18N.tnx` to improve translatability.
Comment 1 Tomás Cohen Arazi (tcohen) 2024-12-12 11:32:29 UTC
Created attachment 175395 [details] [review]
Bug 38684: Improve translatability in cat-toolbar.inc

This patch converts strings using

* *subscription(s)*
* *item(s)*

into different strings for the singular and plural forms. This helps
translating and is also more accurate for the end user.

To test:
1. Have a record with 2 items and 2 subscriptions
2. hover on the _Edit > Delete record_  dropdown item
=> FAIL: Mixed form string about items
3. Delete one item at a time, repeating 2
=> FAIL: Mixed form string at each step
4. Once items are deleted, repeat 2
=> FAIL: Mixed form string about subscriptions
5. Delete one subscription at a time, repeating 2
=> FAIL: Mixed form string at each step
6. Apply this patch
7. Repeat 1-5
=> SUCCESS: Different message in singular and plural forms
=> SUCCESS: The message is correct
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Owen Leonard 2024-12-13 18:01:07 UTC
Created attachment 175464 [details] [review]
Bug 38684: Improve translatability in cat-toolbar.inc

This patch converts strings using

* *subscription(s)*
* *item(s)*

into different strings for the singular and plural forms. This helps
translating and is also more accurate for the end user.

To test:
1. Have a record with 2 items and 2 subscriptions
2. hover on the _Edit > Delete record_  dropdown item
   => FAIL: Mixed form string about items
3. Delete one item at a time, repeating 2
   => FAIL: Mixed form string at each step
4. Once items are deleted, repeat 2
   => FAIL: Mixed form string about subscriptions
5. Delete one subscription at a time, repeating 2
   => FAIL: Mixed form string at each step
6. Apply this patch
7. Repeat 1-5
   => SUCCESS: Different message in singular and plural forms
   => SUCCESS: The message is correct
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Katrin Fischer 2024-12-27 16:12:07 UTC
QA by RM.
Comment 4 Katrin Fischer 2024-12-27 16:36:45 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 5 Jonathan Druart 2025-01-01 20:10:28 UTC
$ koha-translate --update fr-CA --dev kohadev
Can't use an undefined value as a HASH reference at /kohadevbox/koha/misc/translator/tmpl_process3.pl line 134.

git blaming this patch.
Comment 6 Jonathan Druart 2025-01-01 20:25:05 UTC
Created attachment 176048 [details] [review]
Bug 38684: FIX2 Fix koha-translate
Comment 7 Jonathan Druart 2025-01-01 20:27:02 UTC
2 possible fixes.

I think the second one is better. More work/duplication for translators but at least it's clear and there is no weirdness with punctuation.

Note that it would be good to include something about testing the translation workflow when we "improve the translatability" ;)
Comment 8 Jonathan Druart 2025-01-01 20:28:06 UTC
Created attachment 176049 [details] [review]
Bug 38684: FIX1 Fix koha-translate
Comment 9 Jonathan Druart 2025-01-01 20:28:38 UTC
(In reply to Jonathan Druart from comment #7)
> 2 possible fixes.
> 
> I think the second one is better.

Which is the first one submitted :D
"FIX2" is better!
Comment 10 Katrin Fischer 2025-01-02 08:12:48 UTC
I need to check the diff of these with git... currently not spotting the difference.
Comment 11 Katrin Fischer 2025-01-02 09:55:28 UTC
OK; I picked FIX2, but made the commit message a little nicer.

--color-words=. is helpful.
Comment 12 Tomás Cohen Arazi (tcohen) 2025-01-02 12:11:43 UTC
Oops. Thanks Jonathan.
Comment 13 Tomás Cohen Arazi (tcohen) 2025-01-02 12:12:23 UTC
(In reply to Jonathan Druart from comment #7)
> I think the second one is better. More work/duplication for translators but
> at least it's clear and there is no weirdness with punctuation.

Agreed