Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Newbie: Localization with dynamic values
Newbie: Localization with dynamic values [message #522488] Mon, 22 March 2010 18:54 Go to next message
Eclipse UserFriend
Originally posted by: Joachim.Wesenberg.de

Having a problem with localizing the following sample with 3 dynamic
values from a Data Set:

In <VALUE-OF>row["ds_year"]</VALUE-OF>
<VALUE-OF>row["ds_employee"]</VALUE-OF> worked
<VALUE-OF>row["ds_days"]</VALUE-OF> days.

The content key of the local should read "no_of_days_worked". The result
is expected to be "In 2009 John Smith worked 210 days."

I am no JavaScript programmer.
Could you please describe where and what has to be done.

Your help is very much appreciated.

Thanks in advance - Jo Wesenberg
Re: Newbie: Localization with dynamic values [message #522973 is a reply to message #522488] Wed, 24 March 2010 16:11 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Joachim,

Are you trying to externalize the whole message or just the fields. To
get a field you can just use an expression like:

var fld1 = reportContext.getMessage(row["myfiled"],
reportContext.getLocale())
You could then write the full expression like:
"In " + fld1 + +" "+fld2 + " worked " + fld3 + " days";

You should also be able to use reportContext( field, locale, args[] ) to
externalize the whole string.


Jason

Joachim Wesenberg wrote:
> Having a problem with localizing the following sample with 3 dynamic
> values from a Data Set:
>
> In <VALUE-OF>row["ds_year"]</VALUE-OF>
> <VALUE-OF>row["ds_employee"]</VALUE-OF> worked
> <VALUE-OF>row["ds_days"]</VALUE-OF> days.
>
> The content key of the local should read "no_of_days_worked". The result
> is expected to be "In 2009 John Smith worked 210 days."
>
> I am no JavaScript programmer.
> Could you please describe where and what has to be done.
>
> Your help is very much appreciated.
>
> Thanks in advance - Jo Wesenberg
Re: Newbie: Localization with dynamic values [message #523286 is a reply to message #522973] Thu, 25 March 2010 18:42 Go to previous message
Eclipse UserFriend
Originally posted by: Joachim.Wesenberg.de

Am 24.03.2010 17:11, schrieb Jason Weathersby:
> Joachim,
>
> Are you trying to externalize the whole message or just the fields. To
> get a field you can just use an expression like:
>
> var fld1 = reportContext.getMessage(row["myfiled"],
> reportContext.getLocale())
> You could then write the full expression like:
> "In " + fld1 + +" "+fld2 + " worked " + fld3 + " days";
>
> You should also be able to use reportContext( field, locale, args[] ) to
> externalize the whole string.
>
>
> Jason
>
> Joachim Wesenberg wrote:
>> Having a problem with localizing the following sample with 3 dynamic
>> values from a Data Set:
>>
>> In <VALUE-OF>row["ds_year"]</VALUE-OF>
>> <VALUE-OF>row["ds_employee"]</VALUE-OF> worked
>> <VALUE-OF>row["ds_days"]</VALUE-OF> days.
>>
>> The content key of the local should read "no_of_days_worked". The
>> result is expected to be "In 2009 John Smith worked 210 days."
>>
>> I am no JavaScript programmer.
>> Could you please describe where and what has to be done.
>>
>> Your help is very much appreciated.
>>
>> Thanks in advance - Jo Wesenberg


Jason,
thanks very much for your quick response. I am actually trying to
externalize the whole message without variable/dynamic data. Those data
are taken from the data base at run time and should just be plugged into
the externalized/localized message.

Within my original mail, I used html text as an example in how I would
have done it without the localization/externalization capability of BIRT.

Joachim
Previous Topic:Pie Chart grouping issue
Next Topic:Newbie: Chart - (localized?) content of legend
Goto Forum:
  


Current Time: Wed Sep 25 22:10:14 GMT 2024

Powered by FUDForum. Page generated in 0.02959 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top