After looking at the output of Generated Messages files, it looks like I'm 
going to have to write my own parser to handle these types of situations 
creating some kind of cache parser.

Btw, this code generates 


@DefaultLocale("en")
public interface FooMessages extends Messages {
    
    public enum Gender{
        MALE, FEMALE, UNKNOWN;
    }
    @com.google.gwt.i18n.client.Messages.AlternateMessage({"one", "You have 
one tree."})
    @DefaultMessage("Some Message {0}")
    String message(@PluralCount int param);
    
    @com.google.gwt.i18n.client.Messages.AlternateMessage({"MALE", "Some 
other Message Male {0}", 
        "FEMALE", "Some other Message Female {0}"})
    @DefaultMessage("Some Other Message {0}")
    String otherMessage(int something, @Select Gender message);
    
    @DefaultMessage("{0} gave you their credits.")
    @AlternateMessage({
        "MALE", "{0} gave you his credits.",
        "FEMALE", "{0} gave you her credits."
    })
    String gaveCredits(String name, @Select Gender gender);

}

Generates

package com.hello.client;

public class FooMessages_en implements com.hello.client.FooMessages {
  
  public java.lang.String message(int arg0) {
    java.lang.String returnVal = null;
    int arg0_form = new 
com.google.gwt.i18n.client.impl.plurals.DefaultRule_en().select(arg0);
    switch (arg0_form) {
      case 1:  // one
        returnVal = new java.lang.StringBuffer().append("You have one 
tree.").toString();
        break;
    }
    if (returnVal != null) {
      return returnVal;
    }
    return new java.lang.StringBuffer().append("Some Message 
").append(arg0).toString();
  }
  
  public java.lang.String gaveCredits(java.lang.String 
arg0,com.hello.client.FooMessages.Gender arg1) {
    return new java.lang.StringBuffer().append(arg0).append(" gave you their 
credits.").toString();
  }
  
  public java.lang.String otherMessage(int 
arg0,com.hello.client.FooMessages.Gender arg1) {
    return new java.lang.StringBuffer().append("Some Other Message 
").append(arg0).toString();
  }
}

Note the lack of complete ignoring of the @Selector (gaveCredits is a 
complete copy/paste from 
http://code.google.com/webtoolkit/doc/latest/DevGuideI18nMessages.html)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/XfAB0JGC8mcJ.
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