Bug 38377 - Improve translatability of remaining renewals counters
Summary: Improve translatability of remaining renewals counters
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-06 12:29 UTC by Angelic
Modified: 2024-12-30 11:10 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the translation strings for renewals - they now use named placeholders so that the correct order can be translated. Example: - In English: "4 of 5 renewals remaining" - In Turkish: . was incorrectly translated as "4 uzatma hakkınızdan 5 tane kaldı" . is now correctly translated as (5 uzatma hakkınızdan 4 tane kaldı"
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38377: Improve translatability of "%s/%s renewals remaining" (8.48 KB, patch)
2024-11-06 13:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38377: Improve translatability of "%s/%s renewals remaining" (8.53 KB, patch)
2024-12-24 19:22 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Angelic 2024-11-06 12:29:59 UTC
In renewal part there is a missunderstanding. 

Let me explain with an example. The sentence in English: "2 of 3 renewals remaining" is translated as  "2 uzatma hakkınızdan 3 tane kaldı" in Turkish. This is wrong. Right Turkish translation must be like this : "3 uzatma hakkınızdan 2 tane kaldı" 

This information can be seen in (with a user having renewals):

cgi-bin/koha/opac-user.pl page of user. 
cgi-bin/koha/circ/circulation.pl?borrowernumber=xxxx
Comment 1 Jonathan Druart 2024-11-06 13:22:57 UTC
Created attachment 174075 [details] [review]
Bug 38377: Improve translatability of "%s/%s renewals remaining"

See comment 0
The sentence in English: "2 of 3 renewals remaining" is translated as  "2 uzatma hakkınızdan 3 tane kaldı" in Turkish.
This is wrong. Right Turkish translation must be like this : "3 uzatma hakkınızdan 2 tane kaldı"

We cannot use %s/%s as the order will be preserved, we need to use named
placeholders.

Test plan:
Apply this patch
% gulp po:update --lang LANG
Go to misc/translator/po
% git grep 'renewals remaining'
Translate the occurrences, remove fuzzy
sudo koha-translate --update LANG --dev kohadev
restart_all
Enable LANG for both staff and OPAC
Have a look at the checkouts table and notice that the strings have
been correctly translated
Comment 2 David Nind 2024-12-24 19:22:12 UTC
Created attachment 175938 [details] [review]
Bug 38377: Improve translatability of "%s/%s renewals remaining"

See comment 0
The sentence in English: "2 of 3 renewals remaining" is translated as  "2 uzatma hakkınızdan 3 tane kaldı" in Turkish.
This is wrong. Right Turkish translation must be like this : "3 uzatma hakkınızdan 2 tane kaldı"

We cannot use %s/%s as the order will be preserved, we need to use named
placeholders.

Test plan:
Apply this patch
% gulp po:update --lang LANG
Go to misc/translator/po
% git grep 'renewals remaining'
Translate the occurrences, remove fuzzy
sudo koha-translate --update LANG --dev kohadev
restart_all
Enable LANG for both staff and OPAC
Have a look at the checkouts table and notice that the strings have
been correctly translated

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-12-24 19:45:48 UTC
I've signed off, and I think I get the expected results.

I had a lot of trouble following the test plan. 

Testing notes (using KTD):

1. To identify files to change, I used: git grep 'renewals remaining' tr-TR-*

2. I made changes to the po files as set out in [1].

3. The update command didn't work for me (I started with no additional languages installed, so I guess that explains this?): 
   koha-translate --update tr-TR --dev kohadev
   Error: the selected language is not currently installed. Try --install.

4. I got the same result if I ran the command from a root shell (ktd --root --shell).

5. Instead, I did an install: koha-translate --install tr-TR --dev kohadev

6. Results for the OPAC, I get this in the renewals column:

   Turkish:

     Süresi uzatıldı!
     [] Süresini uzat ( 5 uzatma hakkınızdan 4 tane kaldı )

   English:

    Renewed!
    [] Renew ( 4 of 5 renewals remaining )

7. Results for the staff interface: I get this in the renewals column:

   Turkish:

     1 []
     (5 uzatma hakkınızdan 4 tane kaldı)

   English:

     1 []
     (4 of 5 renewals remaining)


[1] Changes made to po files
============================

tr-TR-messages-js.po
--------------------

 724 #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:366
 725 #, fuzzy
 726 msgid "{renewals_left} of {renewals_allowed} renewals remaining"
 727 msgstr "%s uzatma hakkınızdan %s tane kaldı"
 728 
 729 #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:368
 730 #, fuzzy
 731 msgid " and {renewals_left} of {renewals_allowed} unseen renewals remaining"
 732 msgstr "%s uzatma hakkınızdan %s tane kaldı"

Changes:
- Changed 727 and 732 to: msgstr "{renewals_allowed} uzatma hakkınızdan {renewals_left} tane kaldı"
- Removed #, fuzzy lines x2

tr-TR-messages.po
-----------------

 9372 #, perl-brace-format
 9373 msgid "{renewals_left} of {renewals_allowed} renewals remaining"
 9374 msgstr ""

Changes:
- Changed 9374 to: msgstr "{renewals_allowed} uzatma hakkınızdan {renewals_left} tane kaldı"

tr-TR-opac-bootstrap.po
-----------------------

 12940 #. For the first occurrence,
 12941 #. %1$s:  I18N.tx("{renewals_left} of {renewals_allowed} renewals remaining", { renewals_left = ISSUE.renewsleft, renewa      ls_allowed =  ISSUE.renewsallowed }) 
 12942 #. %2$s:  IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed 
 12943 #. %3$s:  ISSUE.unseenleft | html 
 12944 #. %4$s:  ISSUE.unseenallowed | html 
 12945 #. %5$s:  END 
 12946 #: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt:469
 12947 #: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt:487
 12948 #: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt:495
 12949 #: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt:503
 12950 #: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt:809
 12951 #, fuzzy, c-format
 12952 msgid "( %s %s / %s of %s renewals left before the item must be seen by the library %s )"
 12953 msgstr "( %s izin verilenden %s tane kalan uzatma hakkı %s / %s izin verilenden %s materyal kütüphane tarafından görülme      lidir %s )"
 
 12970 #. %1$s:  ISSUE.renewsleft | html 
 12971 #: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt:480
 12972 #, c-format
 12973 msgid "Item must be renewed at the library. %s renewals remaining"
 12974 msgstr "Materyalin süresi kütüphanede uzatılmalıdır. %s Kalan uzatma hakkı"

Didn't make any changes.

tr-TR-staff-prog.po
-------------------

No occurrences, didn't make any changes.
Comment 4 Katrin Fischer 2024-12-30 11:10:12 UTC
Pushed for 25.05!

Well done everyone, thank you!