Text Bundle : ListResourceBundle « I18N « Java






Text Bundle

 
import java.util.ListResourceBundle;

class TextBundle extends ListResourceBundle {
  public Object[][] getContents() {
    return contents;
  }

  static final Object[][] contents = { { "dog", "dog" }, { "cat", "cat" }, { "horse", "horse" },
      { "cow", "cow" }, { "elephant", "elephant" } };
}

class TextBundle_es extends ListResourceBundle {
  public Object[][] getContents() {
    return contents;
  }

  static final Object[][] contents = { { "dog", "perro" }, { "cat", "gato" },
      { "horse", "caballo" }, { "cow", "vaca" }, { "elephant", "elefante" } };
}

 








Related examples in the same category

1.extends List Resource bundle
2.Your own Resource Bundle based on ListResourceBundle