If you want to print a basketgroup with pdf format, it will be in english. The pdf is done with layout2pages.pm or layout3pages.pm which call layout2pages.pdf or layout3pages.pdf. This patch adds layout3pagesfr.pm in src/acqui/pdfformat/ which calls layout3pagesfr.pdf. And adds in basketgroup.pl the check for layout3pagesfr To use it you have to change the systempreferences to pdfformat::layout3pagesfr
Created attachment 19577 [details] [review] proposed patch thx for testing
Shouldn't "pdfformat::layout3pagesfr" be added as a choice to the pref file? For that matter, shouldn't "pdfformat::layout2pages" and "pdfformat::layout3pages" also be built into the pref file for selection, or do I misunderstand how this preference works? Is there a reason why pdfformat isn't selectable at the time of printing? Why should it be a global preference?
Hi Owen, you have raised some very good points! I think that having an option to choose the template before generating it would be great. Also as the values are kind of hardcoded now we could have a pull down instead of having people to know the exact name to put in.
Hello Owen and Katrin, thx for your comments, in fact as often, I have made a little patch for a customer who is waiting a quick and efficient result. But I agree with you, the things are not very good in the present state. I am not sure to well understand what do you mean Owen, first about the syspref ' OrderPdfFormat', in his actual state you have to put the right string in it, do you mean it would be better to have a drop down list with 3 (with my french patch) choices in it ? Well, this would be more ergonomic, yes. In an older version of koha we had a second syspref to choose the pdf template or maybe it was a specific dev. made by us, anyway I agree, it would be better to have the opportunity to change the pdf template. In the present state, the call of the pdf template is hard-coded in the layoutXpages.pm, but I think it would be better to have the hand on the choice. In fact the matter is that we have a .pm with text in it (the reason why I have created a new one) and this .pm is pointing on a pdf template with some text too. In the .pm you have also all the format for placing the text and the numbers. It is the reason why you have layout2pages.pm and layout3pages.pm, both in English, in fact these .pm are kind of templates and need to be adapted, for instance if the name or address of the library is too long, and over that layer, you add the pdf file, and in the same way each library can change the text in it or the place of a column, a frame... So for a translation we have two files to create. To resume, it would be better to have a ddl for the syspref and maybe an other in the basketgroup.pl to choose the pdf template. More, it would be better to have all the text in the pdf, the translation would be easier. But the purpose of my patch is just to have the printing in French with the existing code, it does no more. Maybe, Katrin and Owen, we should create a new bug report for these improvements ?
Hello Could you take a look at this patch I made some months ago? I think it is related : http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10135 It is not good, according to Jonathan, but maybe the idea could be improved. My idea was to give the ability to each Library to define its own Template (we did it in Rennes 2, but we had to alter the perl code because currently only the 2 values "pdf2pages" and "pdf3pages" are accepted"). I probably tried to make up a too complex solution. Mathieu
Hello Mathieu, yes your patch is related with the discussion between Owen and Katrin. And amha it would be better to have a drop down list for this syspref, to avoid the risk of mistyping. I disagree with Jonathan, because your solution is more oriented user, and I think it is not user friendly to have such a string to type "pdfformat::layout3pages" But, the purpose of my patch is to add a french translation in the actual state of the code. Your patch is not conflicting with mine. Ok for me.
I did not test yours, but as you said, it is probably not conflicting. That being said, in the long term, the current way Koha is dealing with template models of basket groups is not realy compatible with a "clean" way of doing internationalization in every languages... And it is not properly supporting non latin scripts. I think a long time solution would be to generate a HTML file and to convert it into pdf, rather than creating directly a pdf. And we could imagine a customized CSS so that some libraries could change easily some elements of the display. What do you think of that? Maybe it would need a lot of work, and could be done only for 3.14 or 3.16 (?), while your patch could be easily backported to 3.12/10/8/6. So I think your patch deserved to be tested. But it is holidays for me, so I will take a look next month ;-) Mathieu
Created attachment 20186 [details] [review] Bug 10573: French translation for printing a basketgroup If you want to print a basketgroup with pdf format, it will be in english. The pdf is done with layout2pages.pm or layout3pages.pm which call layout2pages.pdf or layout3pages.pdf. This patch adds layout3pagesfr.pm in src/acqui/pdfformat/ which calls layout3pagesfr.pdf. And adds in basketgroup.pl the check for layout3pagesfr To use it you have to change the systempreferences to pdfformat::layout3pagesfr Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described, koha-qa reports some tab errors. Corrected in a followup. Please, always add a test plan, it's easier to test. Test: 1) apply the patch 2) change syspref OrderPdfFormat to pdfformat::layout3pagesfr 3) select a vendor 4) create a basket group (empty works) 5) close basket group 6) print basket group 7) PDF is in french
Created attachment 20187 [details] [review] Bug 10573 - Folloup - French translation for printing a basketgroup small followup to fix tabs Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Hi Christophe, I found a small thing you missed: Page 2 / 3 Could you explain how you did the translation? Is it enough to just translate the odt and print it as PDF to create the PDF file? I am passing QA on this. The current system of handling the templates for basket group printing is not good, but I can understand the need to have a translated template available. I have created an omnibus bug to bundle all related bug reports.
Created attachment 20432 [details] [review] [PASSED QA] Bug 10573: French translation for printing a basketgroup If you want to print a basketgroup with pdf format, it will be in english. The pdf is done with layout2pages.pm or layout3pages.pm which call layout2pages.pdf or layout3pages.pdf. This patch adds layout3pagesfr.pm in src/acqui/pdfformat/ which calls layout3pagesfr.pdf. And adds in basketgroup.pl the check for layout3pagesfr To use it you have to change the systempreferences to pdfformat::layout3pagesfr Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described, koha-qa reports some tab errors. Corrected in a followup. Please, always add a test plan, it's easier to test. Test: 1) apply the patch 2) change syspref OrderPdfFormat to pdfformat::layout3pagesfr 3) select a vendor 4) create a basket group (empty works) 5) close basket group 6) print basket group 7) PDF is in french Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> This works nicely, although it would be better if we could find a more general solution to make the templates editable and translatable.
Created attachment 20433 [details] [review] [PASSED QA] Bug 10573 - Followup - French translation for printing a basketgroup small followup to fix tabs Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Pushed to master. Thanks, Christophe! I agree that a more general solution is required for the future.
This patch has been pushed to 3.12.x, will be in 3.12.5. Thanks Christophe!
Pushed to 3.10.x, will be in 3.10.11
(In reply to Katrin Fischer from comment #10) > Hi Christophe, > > I found a small thing you missed: Page 2 / 3 > Could you explain how you did the translation? Is it enough to just > translate the odt and print it as PDF to create the PDF file? > > I am passing QA on this. The current system of handling the templates for > basket group printing is not good, but I can understand the need to have a > translated template available. I have created an omnibus bug to bundle all > related bug reports. Hello Katrin, yes in fact after the translation I save as PDF the odt. Thx for your help