InformationPhotography |
Tuesday, March 6. 2012Java Enum OverrideTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Just curious how you might implement something that requires localization in this case? As I assume the reason to do this is to be able to display that text someplace. Or is there another reason to have the string that way that I'm missing?
Internationalization in Java is usually done using Resource Bundles, so it would be a matter of getting the resource bundle for the locale using ResourceBundle b = ResourceBundle.getBundle("Galaxies") which would retrieve "Galaxies_en_US" if that is your current locale, then you would change the return function for MilkyWay to return b.getString("Milky Way").
|
QuicksearchLexiyntax @ Twitter
Categories |