On 21 Jan., 23:36, Thomas Broyer <t.bro...@gmail.com> wrote: > On 20 jan, 21:23, thm <gmtest...@googlemail.com> wrote: > > > Hey gurus, > > using GWT 2.0 I fiddled around with i18n and plural forms. From the > > examples I thought I could write > > > addressBookTab_removeAddressConfirmationDialogTitle=Remove {0,number} > > Addresses? > > addressBookTab_removeAddressConfirmationDialogTitle[one]=Remove > > Address? > > > in my properties file and then run the I18NSync tool and have my java > > interface generated. However, what I get is: > > > /** > > * Translated "Remove {0,number,integer} Addresses?". > > * > > * @return translated "Remove {0,number,integer} Addresses?" > > */ > > @DefaultMessage("Remove {0,number,integer} Addresses?") > > @Key("addressBookTab_removeAddressConfirmationDialogTitle") > > String addressBookTab_removeAddressConfirmationDialogTitle(String > > arg0); > > > /** > > * Translated "Remove Address?". > > * > > * @return translated "Remove Address?" > > */ > > @DefaultMessage("Remove Address?") > > @Key("addressBookTab_removeAddressConfirmationDialogTitle[one]") > > String addressBookTab_removeAddressConfirmationDialogTitle_one_(); > > > Even worse, when I manually write a method like > > > @DefaultMessage("Remove {0,number} Addresses?") > > @PluralText({"one", "Remove Address?"}) > > String addressBookTab_removeAddressConfirmationDialogTitle > > (@PluralCount int addressCount); > > > everything works as expected. But when I run I18NSync again, it > > _overwrites_ the method with the two methods shown above. That's not > > exactly "sync", it's more like "fuck it up", rather. > > > What am I doing wrong? > > I believe I18NSync is going to become deprecated. > > Why don't you write your interface first with the appropriate > @Generate annotation and then grab the generated *.properties file (in > the -extra dir) to help you translate your app? > When you need a new "label" in your app, just create a new method in > your Messages interface, with the appropriate @DefaultValue > annotation; if you need help in updating your translated *.properties > file, then compile your app with the "-extra somefolder" argument and > grab the generated properties file to see what you should add to your > other files.
Yeah, I had the feeling that I18NSync would be bit-rotting. I started with the workflow I described because the docs I read on the GWT pages made me believe that this is the suggested way. And actually I like it. Writing a simple properties file and having all that boilerplate code that I don't want to care about generated instead of having to write it all by myself sounds nicer to me. I don't see any advantages having to do it the other way. Unfortunately, it seems like I am forced to ("forced" of course meaning being not too inclined to writing my own I18NSync tool). But I am curious: are there any advantages doing it the way you outlined? Thanks and regards, Thomas -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.