Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 872801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:50:16+00:00 2026-05-15T10:50:16+00:00

I’m using GWT internationalization Messages. The documentation for Plural Forms says this should work:

  • 0

I’m using GWT internationalization Messages. The documentation for Plural Forms says this should work:

@DefaultMessage("{0} {1,number} hours {2}")
@PluralText({"one", "an hour"})
String hours(String prefix, @PluralCount int count, String suffix);

Well, it doesn’t. Whatever value of count it still delivers DefaultMessage (e.g. “1 hours ago”). Same if I use a .properties file:

hours[one]=an hour
hours[few]=some hours
hours={0} {1,number} hours {2}

Is there a bug in the docs or in GWT (I’m using GWT 2.0.3) or in me? If any of the two former, anyone knows of a workaround?

EDIT: More clues to this mystery. I can get plural handling to work if I don’t rely on default locale handling. That is, I need:

  • In my module’s gwt.xml file:

    <extend-property name="locale" values="en"/>

  • In my Messages extentsion:

    @DefaultLocale("en")

    public interface MyMessages extends Messages { ...

  • Explicitly load the “en” locale by appending to the URL

    &locale=en

See http://groups.google.com/group/google-web-toolkit/browse_thread/thread/80ae300213cc6adb where I have cross posted this question.

EDIT 2: The reason I entered this GWT plurals land is that I’m creating a “GWT HUman Readable Relative Timestamps” module. Open sourced at GitHub: http://github.com/PEZ/GWT-Relative-Time Please check it out. It’ll very soon have correct singular forms and support for some languages. =)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:50:16+00:00Added an answer on May 15, 2026 at 10:50 am

    Getting used to answering my own questions =) Here’s cross post of my “answer” on the GWT Google group:

    There seems to be a bug with the default locale handling. Here’s how I have reached that conclusion:

    I wanted to add some locales to my module. Figured I could get a boiler plate for the properties file if I used the @Generate annotation. I noticed that it created both an _en.properties file and a _default.properties. What’s more; the _en file completely lacked the plural form info! The _default file had them though.

    I then moved the _defaults file to the same directory as my TimeMessages.java file and renamed it TimeMessages_default.properties.

    With this in place I can remove <extend-property name="locale" values="en"/> from my module’s .gwt.xml file and, more important, the &locale=en from the URL when running my app. I still need the @DefaultLocale("en") annotation though, even though the documentation clearly states that this is not necessary.

    In conclusion, if you run into this problem, try:

    • generating properties files using @Generate
    • place YourMessages_default.properties side by side with YourMessages.java
    • prepend the YourMessages interface with a @DefaultLocale("en") annotation.

    About that @Generate. This is what worked for me. Just before my extension of the Message interface:

    @Generate(format = {"com.google.gwt.i18n.rebind.format.PropertiesFormat"})
    

    The GWT log said it created my properties file, but I couldn’t find it. I fixed that by adding the compiler flag -extra extras and then found the properties files generated in the extras directory. Including this info here since I spent more than an hour figuring it out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.