Description
Jonathan Druart
2013-09-23 15:05:23 UTC
Created attachment 21377 [details] [review] Bug 10935: CSV are broken using other language than english. To reproduce: - cd misc/translator - ./translate update LANG - ./translate install LANG - go to the Koha mainpage and change the language. - go to acqui/basketgroup.pl?booksellerid=XX and try to export a basketgroup. The headers is followed by the first basketgroup information. There is no carriage return. It looks like it is caused by a routine used by the translator script (TmplTokenizer::string_canon). To test this patch: - apply it - cd misc/translator - ./translate -f update LANG - translate headers in your po file - ./translate -f install LANG - go to acqui/basketgroup.pl?booksellerid=XX and try to export a basketgroup. - verify that the csv looks good now. - same thing for basket. Created attachment 21388 [details] [review] [SIGNED OFF] Bug 10935: CSV are broken using other language than english. To reproduce: - cd misc/translator - ./translate update LANG - ./translate install LANG - go to the Koha mainpage and change the language. - go to acqui/basketgroup.pl?booksellerid=XX and try to export a basketgroup. The headers is followed by the first basketgroup information. There is no carriage return. It looks like it is caused by a routine used by the translator script (TmplTokenizer::string_canon). To test this patch: - apply it - cd misc/translator - ./translate -f update LANG - translate headers in your po file - ./translate -f install LANG - go to acqui/basketgroup.pl?booksellerid=XX and try to export a basketgroup. - verify that the csv looks good now. - same thing for basket. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Good idea and seems to work - just fixing a small glitch with the first entry of the list in a follow-up. Created attachment 21389 [details] [review] Bug 10935: Follow-up - adding a line break to fix first list item Without the line break after the include the first entry of our list of orders was behind the header row in the first row of the spreadsheet. Adding the line break seems to fix that and translated CSV can be exported correctly now. Hi Jonathan, can you please check my follow-up and sign off? (In reply to Katrin Fischer from comment #4) > Hi Jonathan, can you please check my follow-up and sign off? Katrin, Yes! I started on the same way but it did not work. An empty line existed between the headers and the first row. In fact, if there is no entry in the po file, it does not work. But if an entry exists, your patch fixes the issue. Thanks for testing. Created attachment 21397 [details] [review] Bug 10935: Follow-up - adding a line break to fix first list item Without the line break after the include the first entry of our list of orders was behind the header row in the first row of the spreadsheet. Adding the line break seems to fix that and translated CSV can be exported correctly now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 21400 [details] [review] Bug 10935: CSV are broken using other language than english. To reproduce: - cd misc/translator - ./translate update LANG - ./translate install LANG - go to the Koha mainpage and change the language. - go to acqui/basketgroup.pl?booksellerid=XX and try to export a basketgroup. The headers is followed by the first basketgroup information. There is no carriage return. It looks like it is caused by a routine used by the translator script (TmplTokenizer::string_canon). To test this patch: - apply it - cd misc/translator - ./translate -f update LANG - translate headers in your po file - ./translate -f install LANG - go to acqui/basketgroup.pl?booksellerid=XX and try to export a basketgroup. - verify that the csv looks good now. - same thing for basket. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Good idea and seems to work - just fixing a small glitch with the first entry of the list in a follow-up. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 21401 [details] [review] Bug 10935: Follow-up - adding a line break to fix first list item Without the line break after the include the first entry of our list of orders was behind the header row in the first row of the spreadsheet. Adding the line break seems to fix that and translated CSV can be exported correctly now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Pushed to master. Thanks, Jonathan! This patch has been pushed to 3.12.x, will be in 3.12.8. Thanks Jonathan! It looks like this bug has made a new appearance - I am seeing the problem again on master and 3.16 stable. I think the problem again is a missing line break, but I don't know how to fix it. Turns out, I was looking at the wrong installation. 3.14: All information appears on one single line for the translated version, the English CSV is ok. Master: We have way too many line breaks: 2 blank lines between the header row and the first line and 1 blank line after each order line? Actually... after fixing some mess here it works wonderfully on master and I can only reproduce it on 3.14.6. Sorry for causing so much confusion. Could someone do me a favor and retest this? Because I think I am going a bit crazy here... first it was 2 different installations I was looking at, now I missed to undo a change to the file I had done to see if that would fix the problem. But I am pretty sure now that it's really broken in 3.14 and on master. Tested in braod daylight... the bug can no longer be found on current master. I reproduced on 3.14.x... Note: The problem still exist on 3.14.x, even with these 2 patches. The 2 files modules/acqui/csv/basket.tt and includes/csv_headers/acqui/basket.tt are the same on 3.14.x and on master. BUT if they are translated, on master a blank line exist between headers and the first data row, on 3.14.x, they are on the same line. I am reopening it for 3.14.x Note that I didn't find the problem, if somebody want to have a look... Good news! It seems to be fixed in 3.14.7. I used git-bisect and the following commit fixes the problem: c0dd6bf598da1214d279977286762611eeff372b is the first bad commit commit c0dd6bf598da1214d279977286762611eeff372b Author: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Date: Mon May 26 05:43:05 2014 -0300 Translation updates for 3.14.07 release :040000 040000 36759bb1e8c5b2904e5925852c2ad616f8672a40 7b0369787a19884a9dc84de400dc0fba44639870 M misc |