gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.53k stars 378 forks source link

I18NCreator only outputs String method arguments #9049

Open dankurka opened 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 9114

The I18NCreator script only creates method signatures of type String in the created
Messages interfaces.  This makes it difficult to recreate the a fresh interface form
updated properties file if arguments of other than type String are used.

Found in GWT Release (e.g. 2.4.0, 2.5.1, trunk):

trunk

Encountered on OS / Browser (e.g. WinXP, IE9, FF10):

Not applicable

Detailed description (please be as specific as possible):

MessageInterfaceCreator ignores any MessageFormat information provided in the template
and always outputs method arguments as String

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

A properties file entry like this:

integerArg0={0,number,integer} items

produces a method signature like

String integerArg0(String arg0);

We would like the argument to be the correct type indicated in the MessageFormat

Workaround if you have one:

Manually edit interface after creation

Links to relevant GWT Developer Forum posts:

Link to patch posted at http://gwt-review.googlesource.com

Reported by travis.schmidt on 2015-01-29 18:45:24

dankurka commented 9 years ago
I created this issue for a patch I want to submit that updates the I18NCreator to more
accurately reflect the Messages that are in a properties file.  Besides trying to get
the correct argument type I added support for GWT specific use cases such as {0,list},
Plural forms, and SafeHtml.  I also added code to fix the JavaDoc @Param issue found
here :

http://code.google.com/p/google-web-toolkit/issues/detail?id=8943&q=i18nsync&colspec=ID%20Type%20Status%20Owner%20Milestone%20Summary%20Stars

When I get this patch cleanly into Gerrit I will post the patch link here as well.

Travis

Reported by travis.schmidt on 2015-01-29 19:09:48

lildesert commented 7 years ago

Hi dankurka,

I wonder what's the status of this issue because I saw that a PR has been opened about this 2 years ago but it hasn't been merged (https://gwt-review.googlesource.com/#/c/11390/). I'm currently looking for a way to generate i18n interfaces based on the properties file with gender support.

dankurka commented 7 years ago

I am not working on this, the reason I am referred here is that I migrated issues from google code to github.

Waxolunist commented 7 years ago

Please merge this patch. I tried it and it is a real improvement to the i18ncreator.

GoGoCarl commented 7 years ago

Yes, please merge!