[jboss-user] [JBoss Seam] - Re: howto display the an enum object internationalized

lcoetzee do-not-reply at jboss.com
Fri Aug 3 10:10:21 EDT 2007


What we do is the following:


  | public enum GenderEnum {
  |         FEMALE, MALE;
  |         
  |         public final static String translatedGenders[][] = {
  |                 {"Female", "Male"},
  |                 {"Vroulik", "Manlik"},
  |                 {"Female - Zulu", "Male -Zulu"},
  |                 {"Female - ndebele", "Male - ndebele"},
  |                 {"Female - xhosa", "Male - xhosa"},
  |                 {"Female - sotho", "Male - sotho"},
  |                 {"Mosadi", "Monna"},
  |                 {"Female - setswana", "Male - setswana"},
  |                 {"Female - siswati", "Male - siswati"},
  |                 {"Female - venda", "Male - venda"},
  |                 {"Female - songa", "Male - songa"} };
  | }
  | 
  | 

Which is then accessed (in Java or JSF)



  | GenderEnum.translatedGenders[userEnvironment.getLanguage().ordinal()]
  |                                 [GenderEnum.MALE.ordinal()]

If you want to get a specific translation for a specific enum.

Regards

Louis

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070610#4070610

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070610



More information about the jboss-user mailing list