Bug 18367

Summary: Fix untranslatable string from Bug 18264
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: I18N/L10NAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: f.demians, fridolin.somers, jonathan.druart, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 18264    
Bug Blocks:    
Attachments: Bug 18367 - Fix untranslatable string from Bug 18264
Bug 18367 - Fix untranslatable string from Bug 18264
Bug 18367 - Fix untranslatable string from Bug 18264
Bug 18367 - Fix untranslatable string from Bug 18264
Bug 18367 - (QA Followup) Only warn if doing a lookup and not having an item

Description Katrin Fischer 2017-04-02 16:39:54 UTC
Bug 18264 added the following line to the .pl file:
+my $inumber = $itemnumber ? "(blank) (itemnumber:$itemnumber)" : "";

This blank is untranslatable.
Comment 1 Nick Clemens (kidclamp) 2017-04-11 20:13:25 UTC
Created attachment 62065 [details] [review]
Bug 18367 - Fix untranslatable string from Bug 18264

Restore display of message when no barcode found

To test:
1 - Go to course reserves
2 - Add an item to a course
3 - Try adding an invalid barcode - should get an alert
4 - Try force adding an item with itemnumber:
    http://localhost:8081/cgi-bin/koha/course_reserves/add_items.pl?op=lookpup&course_id=11&itemnumber=1234523546
5 - Should recieve an error
Comment 2 Owen Leonard 2017-04-24 16:00:44 UTC
I think this isn't the right way to format the string. As it is now, the po file for this string looks like this:

"No item found with barcode %s"

After this patch, it looks like this:

"No item found %swith barcode %s%s"

I think the latter is going to be more confusing to translators. It's more verbose, but I wonder if this would be better:

        [% IF ERROR_ITEM_NOT_FOUND %]
            [% IF UNKNOWN_BARCODE %]
                <div class="dialog alert">No item found with barcode [% UNKNOWN_BARCODE %]</div>
            [% ELSE %]
                 <div class="dialog alert">No item found</div>
            [% END %]
        [% END %]
Comment 3 Katrin Fischer 2017-05-14 10:59:40 UTC
Yep, it would be better. Grammar works differently in different languages, so always better not to assume every language can 'glue' sentences together like in English.
Comment 4 Nick Clemens (kidclamp) 2017-07-07 11:30:08 UTC
Created attachment 64907 [details] [review]
Bug 18367 - Fix untranslatable string from Bug 18264

Restore display of message when no barcode found

To test:
1 - Go to course reserves
2 - Add an item to a course
3 - Try adding an invalid barcode - should get an alert
4 - Try force adding an item with itemnumber:
    http://localhost:8081/cgi-bin/koha/course_reserves/add_items.pl?op=lookpup&course_id=11&itemnumber=1234523546
5 - Should recieve an error
Comment 5 Frédéric Demians 2017-07-08 08:14:40 UTC
Created attachment 64933 [details] [review]
Bug 18367 - Fix untranslatable string from Bug 18264

Restore display of message when no barcode found

To test:
1 - Go to course reserves
2 - Add an item to a course
3 - Try adding an invalid barcode - should get an alert
4 - Try force adding an item with itemnumber:
    http://localhost:8081/cgi-bin/koha/course_reserves/add_items.pl?op=lookpup&course_id=11&itemnumber=1234523546
5 - Should recieve an error

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 6 Jonathan Druart 2017-07-13 19:42:37 UTC
Created attachment 65026 [details] [review]
Bug 18367 - Fix untranslatable string from Bug 18264

Restore display of message when no barcode found

To test:
1 - Go to course reserves
2 - Add an item to a course
3 - Try adding an invalid barcode - should get an alert
4 - Try force adding an item with itemnumber:
    http://localhost:8081/cgi-bin/koha/course_reserves/add_items.pl?op=lookpup&course_id=11&itemnumber=1234523546
5 - Should recieve an error

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2017-07-13 21:41:49 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Fridolin Somers 2017-07-27 14:19:31 UTC
I check for 17.05.x.

There is a problem :
When clicking "Add reserves" on a course, you directly get "No item found" warning.
This does not happen without patch.
Comment 9 Nick Clemens (kidclamp) 2017-07-28 11:39:24 UTC
Created attachment 65311 [details] [review]
Bug 18367 - (QA Followup) Only warn if doing a lookup and not having an item
Comment 10 Jonathan Druart 2017-07-28 14:38:19 UTC
Last patch pushed to master for 17.11
Comment 11 Fridolin Somers 2017-07-31 08:52:46 UTC
Pushed to 17.05.x, will be in 17.05.03.
Comment 12 Katrin Fischer 2017-08-01 05:56:42 UTC
These patches have been pushed to 16.11.x and will be in 16.11.11.