Last active
August 29, 2015 14:10
-
-
Save oehme/a00c6a2745ea25adcdc0 to your computer and use it in GitHub Desktop.
Localization ResourceBundle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyMessages { | |
private ResourceBundle bundle; | |
public MyMessages(Locale locale) { | |
this.bundle = ResourceBundle.getBundle("MyMessages", locale); | |
} | |
public String trains(Number arg0) { | |
String pattern = bundle.getString("Trains"); | |
MessageFormat format = new MessageFormat(pattern); | |
return format.format(new Object[]{arg0}); | |
} | |
//more methods here... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment