Bug 25443

Summary: Improve translation of "Select the host record to link%s to"
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: I18N/L10NAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, bgkriegel, f.demians, jonathan.druart, julian.maurice, lucas, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03, 19.11.09
Attachments: Bug 25443: Improve translation of 'Select the record to link%s to'
Bug 25443: Improve translation of 'Select the record to link%s to'
Bug 25443: (follow-up) sorround strings with <span>
Bug 25443: Improve translation of 'Select the record to link%s to'
Bug 25443: (follow-up) surround strings with <span>

Description Katrin Fischer 2020-05-10 11:34:36 UTC
<label for="barcode_fieldset">Select the host record to link[% IF ( bibliotitle ) %] to <i>[% bibliotitle | html %]</i>[% END %]</label>

Turns into:

Select the host record to link%s to

This is quite hard to translate. The %s here is the IF, not the title, so you can't move where the title appears if present, which doesn't work in all languages. This is probably due to the <i> used here.
Comment 1 Bernardo Gonzalez Kriegel 2020-05-19 16:55:04 UTC
Removing "<i>...</i>" produces "Select the host record to link%s to %s%s"

Other option would be
"Select the host record to link"
and
"Select the host record to link to %s"
taking the IF out, or the message in, and using an [% ELSE %]

What would be the best option?
Comment 2 Katrin Fischer 2020-05-23 23:58:56 UTC
I think both would be better, but the second option is probably easiest for not so experienced translators. Moving around the %s is not so often done I think.
Comment 3 Katrin Fischer 2020-05-24 00:08:50 UTC
Created attachment 105309 [details] [review]
Bug 25443: Improve translation of 'Select the record to link%s to'

Before this patch the title was set in italic, which caused the
translation string to be cut off. Removing the italic formatting in
favor of quotes and splitting the string into 2 sentences (dealing
with title existing and not existing:

Select the host record to link to '[% bibliotitle | html %]'
Select the host record to link

To test:
- Activate EasyAnalyticalRecords system preference
- Search for a record in staff
- Use Edit > Link to host record
- Verify the text is shown as above with the reord's title
- The second case is a bit theoretical:
- Delete 245$a from the record or empty out biblio.title using SQL
- Verify the string still shows but without the 'to...' part.
Comment 4 Bernardo Gonzalez Kriegel 2020-05-24 01:22:07 UTC
In that case, will you consider (In reply to Katrin Fischer from comment #2)
> I think both would be better, but the second option is probably easiest for
> not so experienced translators. Moving around the %s is not so often done I
> think.

Ok :)
In that case, could you consider surrounding the text with <span>...</span>?
If not we get this string 
"%s Select the host record to link to '%s' %s Select the host record to link %s "

With span we get
msgid "Select the host record to link"
msgid "Select the host record to link to '%s'"
Comment 5 Bernardo Gonzalez Kriegel 2020-05-24 11:58:20 UTC
Created attachment 105315 [details] [review]
Bug 25443: Improve translation of 'Select the record to link%s to'

Before this patch the title was set in italic, which caused the
translation string to be cut off. Removing the italic formatting in
favor of quotes and splitting the string into 2 sentences (dealing
with title existing and not existing:

Select the host record to link to '[% bibliotitle | html %]'
Select the host record to link

To test:
- Activate EasyAnalyticalRecords system preference
- Search for a record in staff
- Use Edit > Link to host record
- Verify the text is shown as above with the reord's title
- The second case is a bit theoretical:
- Delete 245$a from the record or empty out biblio.title using SQL
- Verify the string still shows but without the 'to...' part.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment 6 Bernardo Gonzalez Kriegel 2020-05-24 11:59:02 UTC
Created attachment 105316 [details] [review]
Bug 25443: (follow-up) sorround strings with <span>

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment 7 Bernardo Gonzalez Kriegel 2020-05-24 12:01:37 UTC
Patch works, added follow-up to put strings inside "span".
Comment 8 Katrin Fischer 2020-05-25 20:39:44 UTC
Thx Bernardo, you beat me to it! I was pondering to merge the strings again (just removing the italic). But I guess this is still cleaner.
Comment 9 Julian Maurice 2020-07-03 14:11:35 UTC
Created attachment 106517 [details] [review]
Bug 25443: Improve translation of 'Select the record to link%s to'

Before this patch the title was set in italic, which caused the
translation string to be cut off. Removing the italic formatting in
favor of quotes and splitting the string into 2 sentences (dealing
with title existing and not existing:

Select the host record to link to '[% bibliotitle | html %]'
Select the host record to link

To test:
- Activate EasyAnalyticalRecords system preference
- Search for a record in staff
- Use Edit > Link to host record
- Verify the text is shown as above with the reord's title
- The second case is a bit theoretical:
- Delete 245$a from the record or empty out biblio.title using SQL
- Verify the string still shows but without the 'to...' part.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 10 Julian Maurice 2020-07-03 14:11:39 UTC
Created attachment 106518 [details] [review]
Bug 25443: (follow-up) surround strings with <span>

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 11 Jonathan Druart 2020-07-09 10:05:47 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 12 Lucas Gass 2020-07-24 20:27:28 UTC
backported to 20.05.x for 20.05.03
Comment 13 Aleisha Amohia 2020-08-03 20:21:46 UTC
backported to 19.11.x for 19.11.09
Comment 14 Victor Grousset/tuxayo 2020-09-07 20:47:18 UTC
Enhancement, not backported to 19.05.x.

It's likely that the new strings won't be translated for oldoldstable at this point of the cycle for all but the few most actively translated languages. So that might actually be a translation regression even for languages that are almost fully translated.
All that is just guesswork though.