You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Duto <ol...@pasteur.fr> on 2010/07/30 08:46:43 UTC

Localization like ResourceBundle with argument

Hello everybody,

With ResourceBundle you can create message with arguments : 

title={0,choice,1#Mister|2#Madam|3#Miss}  --> for English

title={0,choice,1#M.|2#Mme|3#Mlle} --> for French

Is there method to do the same think on Pivot with json or a other thinks

I need that for display a TableView where I have a column with the title of
person on numeric format.

Thanks in advance.

I am enthusiastic by Pivot, it's very a great great RIA framework!

Duto
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Localization-like-ResourceBundle-with-argument-tp1008197p1008197.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Localization like ResourceBundle with argument

Posted by Olivier Dutrieux <ol...@pasteur.fr>.
  Of course I seen the Localization tutorial ^^

I answer to me :

To solve my problem, I create a new class TableViewChoiceCellRenderer 
(see attach file) with the same model of TableViewNumberCellRenderer but 
use java.text.ChoiceFormat intance of java.text.NumberFormat and in my 
TableView.Column of wtkx file, I change the cellRender by my new class 
TableViewChoiceCellRenderer :

<TableView.Column name="title" width="35" headerData="Titre">
<cellRenderer>
<content:TableViewChoiceCellRenderer pattern="%title" 
xmlns:content="fr.pasteur.wtk.content"/>
</cellRenderer>
</TableView.Column>

and in my json localization files I define
title:"1#Mr|2#Madam|3#Miss" for English file
and
title:"1#M.|2#Mme|3#Mlle" for French file

Best regards

Duto

Le 30/07/2010 14:07, Greg Brown a écrit :
> Hi,
>
> Have you seen the Localization tutorial?
>
> http://pivot.apache.org/tutorials/localization.html
>
> Greg
>
> On Jul 30, 2010, at 2:46 AM, Duto wrote:
>
>> Hello everybody,
>>
>> With ResourceBundle you can create message with arguments :
>>
>> title={0,choice,1#Mister|2#Madam|3#Miss}  -->  for English
>>
>> title={0,choice,1#M.|2#Mme|3#Mlle} -->  for French
>>
>> Is there method to do the same think on Pivot with json or a other thinks
>>
>> I need that for display a TableView where I have a column with the title of
>> person on numeric format.
>>
>> Thanks in advance.
>>
>> I am enthusiastic by Pivot, it's very a great great RIA framework!
>>
>> Duto
>> -- 
>> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Localization-like-ResourceBundle-with-argument-tp1008197p1008197.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

-- 
Olivier Dutrieux
Études et Projets Informatiques (Tél : 31 62)

Re: Localization like ResourceBundle with argument

Posted by Greg Brown <gk...@mac.com>.
Hi,

Have you seen the Localization tutorial?

http://pivot.apache.org/tutorials/localization.html

Greg

On Jul 30, 2010, at 2:46 AM, Duto wrote:

> 
> Hello everybody,
> 
> With ResourceBundle you can create message with arguments : 
> 
> title={0,choice,1#Mister|2#Madam|3#Miss}  --> for English
> 
> title={0,choice,1#M.|2#Mme|3#Mlle} --> for French
> 
> Is there method to do the same think on Pivot with json or a other thinks
> 
> I need that for display a TableView where I have a column with the title of
> person on numeric format.
> 
> Thanks in advance.
> 
> I am enthusiastic by Pivot, it's very a great great RIA framework!
> 
> Duto
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Localization-like-ResourceBundle-with-argument-tp1008197p1008197.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: Localization like ResourceBundle with argument

Posted by Duto <ol...@pasteur.fr>.
thank for your support Greg,

I did not think of that, but how can you use it title: ["Mr", "Mrs", "Miss"]
with cell of TableView ?

Best regards 

Duto
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Localization-like-ResourceBundle-with-argument-tp1008197p1011314.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.