| 1 | package be.nikiroo.jvcard.resources; |
| 2 | |
| 3 | import java.util.Locale; |
| 4 | import java.util.ResourceBundle; |
| 5 | |
| 6 | /** |
| 7 | * This class help you get UTF-8 bundles for this application. |
| 8 | * |
| 9 | * @author niki |
| 10 | * |
| 11 | */ |
| 12 | public class Bundles { |
| 13 | /** |
| 14 | * Return the non-localised bundle of the given name. |
| 15 | * |
| 16 | * @param name |
| 17 | * the name of the bundle to load |
| 18 | * |
| 19 | * @return the bundle |
| 20 | */ |
| 21 | static public ResourceBundle getBundle(String name) { |
| 22 | return ResourceBundle.getBundle(Bundles.class.getPackage().getName() |
| 23 | + "." + name, new FixedResourceBundleControl()); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Return the localised bundle of the given name and {@link Locale}. |
| 28 | * |
| 29 | * @param name |
| 30 | * the name of the bundle to load |
| 31 | * @param locale |
| 32 | * the {@link Locale} to use |
| 33 | * |
| 34 | * @return the localised bundle |
| 35 | */ |
| 36 | static public ResourceBundle getBundle(String name, Locale locale) { |
| 37 | |
| 38 | return ResourceBundle.getBundle(Bundles.class.getPackage().getName() |
| 39 | + "." + name, locale, new FixedResourceBundleControl()); |
| 40 | } |
| 41 | } |