Thanks! It works now. :)

After reading through the GWT doc [1], I thought the third argument
wasn't necessary. Also, I didn't know that 'text' is a valid value for
the format argument, since I found examples only for number and date.

[1]: 
http://code.google.com/webtoolkit/doc/latest/DevGuideI18nMessages.html#GwtFormats

On Dec 15, 10:23 am, Adam T <[email protected]> wrote:
> Hi Luiz,
>
> If you've not stumbled across this already, just add the format marker
> "text" in your message definitions and it should work, i.e.
>
> @DefaultLocale("pt_BR")
> public interface AppMessages extends Messages {
>
>         @DefaultMessage("elementos: {0,list,text}")
>         @AlternateMessage({"one", "elemento: {0,list,text}"})
>         String formatElements(@PluralCount List<String> elements);
>
> }
>
> //Adam
>
> On 15 Dec, 00:43, Luiz Mineo <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I'm trying to format a list of Strings using a Messages interface:
>
> > @DefaultLocale("pt_BR")
> > public interface AppMessages extends Messages {
>
> >         @DefaultMessage("elementos: {0, list}")
> >         @AlternateMessage({"one", "elemento: {0, list}"})
> >         String formatElements(@PluralCount List<String> elements);
>
> > }
>
> > In my module.gwt.xml, I have:
>
> > <!-- languages supported -->
> > <extend-property name="locale" values="pt_BR" />
> > <set-property-fallback name="locale" value="pt_BR" />
>
> > But when I try to format a list, for example:
>
> > AppMessages appMessages = GWT.create(AppMessages.class);
> > appMessages.formatElements(Arrays.asList({"A"}));
> > appMessages.formatElements(Arrays.asList({"A","B","C"}));
>
> > I get:
>
> > "elemento: 1"
> > "elementos: 3"
>
> > Instead of:
>
> > "elemento: A"
> > "elementos: A, B e C"
>
> > I'm using pt_BR for default locale, since it is the only language my
> > app supports for now. Does it only work for en? I tryied to change the
> > default locale for en, but it didn't work either :(
>
> > So, what I'm doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to