Bug 10573 - French translation for printing a basketgroup
Summary: French translation for printing a basketgroup
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Christophe Croullebois
QA Contact:
URL:
Keywords:
Depends on: 10746
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-11 11:04 UTC by Christophe Croullebois
Modified: 2016-01-06 09:05 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
proposed patch (63.75 KB, patch)
2013-07-11 15:43 UTC, Christophe Croullebois
Details | Diff | Splinter Review
Bug 10573: French translation for printing a basketgroup (64.15 KB, patch)
2013-08-08 18:57 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 10573 - Folloup - French translation for printing a basketgroup (1.04 KB, patch)
2013-08-08 18:58 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 10573: French translation for printing a basketgroup (64.36 KB, patch)
2013-08-17 15:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 10573 - Followup - French translation for printing a basketgroup (1.11 KB, patch)
2013-08-17 15:17 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 Christophe Croullebois 2013-07-11 11:04:32 UTC
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
Comment 1 Christophe Croullebois 2013-07-11 15:43:12 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-07-16 16:33:24 UTC
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?
Comment 3 Katrin Fischer 2013-07-17 06:15:26 UTC
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.
Comment 4 Christophe Croullebois 2013-07-17 12:10:02 UTC
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 ?
Comment 5 Mathieu Saby 2013-07-20 20:00:55 UTC
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
Comment 6 Christophe Croullebois 2013-07-22 08:55:55 UTC
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.
Comment 7 Mathieu Saby 2013-07-24 11:41:44 UTC
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
Comment 8 Bernardo Gonzalez Kriegel 2013-08-08 18:57:48 UTC Comment hidden (obsolete)
Comment 9 Bernardo Gonzalez Kriegel 2013-08-08 18:58:59 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2013-08-17 15:16:03 UTC
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.
Comment 11 Katrin Fischer 2013-08-17 15:17:09 UTC
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.
Comment 12 Katrin Fischer 2013-08-17 15:17:34 UTC
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>
Comment 13 Galen Charlton 2013-08-17 16:08:05 UTC
Pushed to master.  Thanks, Christophe!

I agree that a more general solution is required for the future.
Comment 14 Tomás Cohen Arazi (tcohen) 2013-09-13 14:36:18 UTC
This patch has been pushed to 3.12.x, will be in 3.12.5.

Thanks Christophe!
Comment 15 Bernardo Gonzalez Kriegel 2013-09-14 22:41:04 UTC
Pushed to 3.10.x, will be in 3.10.11
Comment 16 Christophe Croullebois 2013-09-16 10:41:23 UTC
(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