You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Pierre Smits <pi...@gmail.com> on 2010/07/21 10:47:07 UTC

Language and PDF generation

Hi all,

In a form I set the language ( that is different to the locale of the user)
of a document,

When generating a PDF I want to use that set language to display labels in
accordance with the setting and not the default locale.

But I am at a loss how to achieve this.

Do you know how to get the right label texts? And can you point me in the
right directions?

Regards,

Pierre

Re: Language and PDF generation

Posted by Bilgin Ibryam <bi...@gmail.com>.
Yes, that's also possible, you just have to put the language parameter to
screenContext.
The way I explained would work for all pdf, w/o need to modify groovy files.

Bilgin

On Wed, Jul 21, 2010 at 11:53 AM, Pierre Smits <pi...@gmail.com>wrote:

> Shouldn't I be able to set the labels in a groovy file with:
>
> uiLabelMap = UtilProperties.getResourceBundleMap("AccountingUiLabels",
> locale);
>
> Whereby I swap the locale with data from the language parameter?
>
> Regards,
>
> Pierre
>
> 2010/7/21 Bilgin Ibryam <bi...@gmail.com>
>
> > Pierre,
> >
> > you need to pass the user selected locale to the printing service as an
> > additional parameter.
> > And then if this printing service uses internally sendPrintFromScreen
> > service, you have to put the additional locale to screenContext parameter
> > of
> > sendPrintFromScreen.
> > The last change you will need is to modify sendPrintFromScreen, so it is
> > not
> > overriding the locale in screenContext with the user current locale.
> >
> > HTH
> > Bilgin
> >
> > On Wed, Jul 21, 2010 at 9:47 AM, Pierre Smits <pierre.smits@gmail.com
> > >wrote:
> >
> > > Hi all,
> > >
> > > In a form I set the language ( that is different to the locale of the
> > user)
> > > of a document,
> > >
> > > When generating a PDF I want to use that set language to display labels
> > in
> > > accordance with the setting and not the default locale.
> > >
> > > But I am at a loss how to achieve this.
> > >
> > > Do you know how to get the right label texts? And can you point me in
> the
> > > right directions?
> > >
> > > Regards,
> > >
> > > Pierre
> > >
> >
>

Re: Language and PDF generation

Posted by Pierre Smits <pi...@gmail.com>.
Shouldn't I be able to set the labels in a groovy file with:

uiLabelMap = UtilProperties.getResourceBundleMap("AccountingUiLabels",
locale);

Whereby I swap the locale with data from the language parameter?

Regards,

Pierre

2010/7/21 Bilgin Ibryam <bi...@gmail.com>

> Pierre,
>
> you need to pass the user selected locale to the printing service as an
> additional parameter.
> And then if this printing service uses internally sendPrintFromScreen
> service, you have to put the additional locale to screenContext parameter
> of
> sendPrintFromScreen.
> The last change you will need is to modify sendPrintFromScreen, so it is
> not
> overriding the locale in screenContext with the user current locale.
>
> HTH
> Bilgin
>
> On Wed, Jul 21, 2010 at 9:47 AM, Pierre Smits <pierre.smits@gmail.com
> >wrote:
>
> > Hi all,
> >
> > In a form I set the language ( that is different to the locale of the
> user)
> > of a document,
> >
> > When generating a PDF I want to use that set language to display labels
> in
> > accordance with the setting and not the default locale.
> >
> > But I am at a loss how to achieve this.
> >
> > Do you know how to get the right label texts? And can you point me in the
> > right directions?
> >
> > Regards,
> >
> > Pierre
> >
>

Re: Language and PDF generation

Posted by Bilgin Ibryam <bi...@gmail.com>.
Pierre,

you need to pass the user selected locale to the printing service as an
additional parameter.
And then if this printing service uses internally sendPrintFromScreen
service, you have to put the additional locale to screenContext parameter of
sendPrintFromScreen.
The last change you will need is to modify sendPrintFromScreen, so it is not
overriding the locale in screenContext with the user current locale.

HTH
Bilgin

On Wed, Jul 21, 2010 at 9:47 AM, Pierre Smits <pi...@gmail.com>wrote:

> Hi all,
>
> In a form I set the language ( that is different to the locale of the user)
> of a document,
>
> When generating a PDF I want to use that set language to display labels in
> accordance with the setting and not the default locale.
>
> But I am at a loss how to achieve this.
>
> Do you know how to get the right label texts? And can you point me in the
> right directions?
>
> Regards,
>
> Pierre
>