Bug 30992 - Hard to translate single word strings
Summary: Hard to translate single word strings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 31272
  Show dependency treegraph
 
Reported: 2022-06-18 10:39 UTC by Katrin Fischer
Modified: 2023-06-08 22:27 UTC (History)
7 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:
22.11.00, 22.05.06


Attachments
Bug 30992: Improve translatability for Waiting at|On hold (4.42 KB, patch)
2022-07-13 06:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30992: Improve translatability for 'for' (2.04 KB, patch)
2022-07-13 06:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30992: Improve translatability for Waiting at|On hold (9.85 KB, patch)
2022-07-13 06:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30992: Improve translatability for 'for' (2.04 KB, patch)
2022-07-13 06:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30992: Improve translatability for 'for' (2.04 KB, patch)
2022-07-19 07:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30992: Improve translatability for Waiting at|On hold (9.90 KB, patch)
2022-07-30 20:47 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30992: Improve translatability for 'for' (2.10 KB, patch)
2022-07-30 20:47 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30992: Improve translatability for Waiting at|On hold (9.97 KB, patch)
2022-08-05 10:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30992: Improve translatability for 'for' (2.16 KB, patch)
2022-08-05 10:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30992: (follow-up) Fix semicolon at line ending (1.10 KB, patch)
2022-08-07 22:12 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 Katrin Fischer 2022-06-18 10:39:20 UTC
There are a few single word strings that are hard to translate without context. Maybe we could use i18n with context hint to make this a little easier:

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt:124
for

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt:448
at

Actually the latter highlights a case, where the spans might have a negative effect as they break the sentence apart into small bits:
https://git.koha-community.org/Koha-community/Koha/src/branch/22.05.x/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt#L440

It's something like:

[Waiting|On hold] for patron X [at|expected at] X [since X]

The main problem here is, that these small bits can translate differently (at least in German) depending on context. In general it's quite bad to build up sentences like this as you don't know if the English grammar will fit any other languages.
Comment 1 Jonathan Druart 2022-07-13 06:02:31 UTC
Created attachment 137664 [details] [review]
Bug 30992: Improve translatability for Waiting at|On hold
Comment 2 Jonathan Druart 2022-07-13 06:02:35 UTC
Created attachment 137665 [details] [review]
Bug 30992: Improve translatability for 'for'
Comment 3 Jonathan Druart 2022-07-13 06:19:47 UTC
Created attachment 137666 [details] [review]
Bug 30992: Improve translatability for Waiting at|On hold
Comment 4 Jonathan Druart 2022-07-13 06:19:51 UTC
Created attachment 137667 [details] [review]
Bug 30992: Improve translatability for 'for'
Comment 5 Jonathan Druart 2022-07-13 06:20:22 UTC
I think those patches are working as you expect.
Comment 6 Katrin Fischer 2022-07-15 09:49:08 UTC
Can this be updated from New to Needs Signoff? :)
Comment 7 Jonathan Druart 2022-07-18 12:54:44 UTC
(In reply to Katrin Fischer from comment #6)
> Can this be updated from New to Needs Signoff? :)

I haven't tested them, but feel free to do so.
Comment 8 Katrin Fischer 2022-07-18 20:07:00 UTC
The second patch doesn't quite work:

-                                        <span>for</span>
-                                            [% IF ( subscription_LOO.numberlength ) %][% subscription_LOO.numberlength | html %] <span>issues</span>[% END %]
-                                            [% IF ( subscription_LOO.weeklength ) %][% subscription_LOO.weeklength | html %] <span>weeks</span>[% END %]
-                                            [% IF ( subscription_LOO.monthlength ) %][% subscription_LOO.monthlength | html %] <span>months</span>[% END %]
+                                            [% IF ( subscription_LOO.numberlength ) %][% subscription_LOO.numberlength | html %] <span>for issues</span>[% END %]

Before:

for x months

Now: 

4 for months
Comment 9 Jonathan Druart 2022-07-19 07:38:21 UTC
Created attachment 137855 [details] [review]
Bug 30992: Improve translatability for 'for'
Comment 10 Katrin Fischer 2022-07-30 20:47:48 UTC
Created attachment 138393 [details] [review]
Bug 30992: Improve translatability for Waiting at|On hold

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2022-07-30 20:47:53 UTC
Created attachment 138394 [details] [review]
Bug 30992: Improve translatability for 'for'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Martin Renvoize 2022-08-05 10:51:57 UTC
Created attachment 138661 [details] [review]
Bug 30992: Improve translatability for Waiting at|On hold

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2022-08-05 10:52:01 UTC
Created attachment 138662 [details] [review]
Bug 30992: Improve translatability for 'for'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2022-08-05 10:52:30 UTC
A clear improvement, no regressions.

Passing QA
Comment 15 Tomás Cohen Arazi 2022-08-05 15:05:39 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 16 Victor Grousset/tuxayo 2022-08-07 15:07:09 UTC
There is a typo here
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138661&action=diff#a/opac/opac-reserve.pl_sec1

            $itemLoopIter->{reservedate}     = $first_hold->reservedate,
            $itemLoopIter->{ExpectedAtLibrary}         = $first_hold->branchcode;

1st line ends with a comma instead of a semicolon.

Shouldn't this not compile and have blown up during testing?
And even the CI should blow up when checking syntax validity.
Comment 17 Katrin Fischer 2022-08-07 15:15:54 UTC
Strange, it didn't explode when I tested or wrote my follow-up.
Comment 18 Katrin Fischer 2022-08-07 22:12:41 UTC
Created attachment 138764 [details] [review]
Bug 30992: (follow-up) Fix semicolon at line ending

$itemLoopIter->{reservedate}     = $first_hold->reservedate,
$itemLoopIter->{ExpectedAtLibrary}         = $first_hold->branchcode;

1st line ends with a comma instead of a semicolon.
Comment 19 Jonathan Druart 2022-08-08 07:14:54 UTC
(In reply to Victor Grousset/tuxayo from comment #16)
> Shouldn't this not compile and have blown up during testing?
> And even the CI should blow up when checking syntax validity.

It's syntaxically valid.
Comment 20 Tomás Cohen Arazi 2022-08-08 18:45:18 UTC
Follow-up pushed to master.
Comment 21 Lucas Gass 2022-09-29 17:00:19 UTC
Backported to 22.05.x for 22.05.06
Comment 22 Arthur Suzuki 2022-10-12 13:31:54 UTC
quite a lot of conflicts while trying to apply on 21.11.x...
If this is really needed I wouldn't refuse some help on the backport (provide backport patch?)