X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fbundles%2FStringIdBundle.java;h=b9a0d797719caf93b35abcf7e59bb508c338d76f;hb=HEAD;hp=24a9252d17a3fefafb2f430d69ad0d50e61e412a;hpb=1163de3dcd121a4c1fb8814b40f39a71813289b1;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/bundles/StringIdBundle.java b/src/be/nikiroo/fanfix/bundles/StringIdBundle.java index 24a9252..b9a0d79 100644 --- a/src/be/nikiroo/fanfix/bundles/StringIdBundle.java +++ b/src/be/nikiroo/fanfix/bundles/StringIdBundle.java @@ -2,40 +2,24 @@ package be.nikiroo.fanfix.bundles; import java.io.File; import java.io.IOException; -import java.util.Locale; import be.nikiroo.utils.resources.TransBundle; /** - * This class manages the translation resources of the application. + * This class manages the translation resources of the application (Core). * * @author niki */ public class StringIdBundle extends TransBundle { - private String lang; - /** * Create a translation service for the given language (will fall back to - * the default one i not found). + * the default one if not found). * * @param lang * the language to use */ public StringIdBundle(String lang) { - super(StringId.class, Target.resources, lang); - this.lang = lang; - } - - /** - * Return the currently used language as a String. - * - * @return the language - * - * @deprecated use the call from {@link TransBundle} when available - */ - public Locale getLanguage() { - return getLocaleFor(lang); - + super(StringId.class, Target.resources_core, lang); } /** @@ -53,39 +37,4 @@ public class StringIdBundle extends TransBundle { new StringIdBundle(null).updateFile(path); System.out.println("Path updated: " + path); } - - /** - * Return the {@link Locale} representing the given language. - * - * @param language - * the language to initialise, in the form "en-GB" or "fr" for - * instance - * - * @return the corresponding {@link Locale} or the default {@link Locale} if - * it is not known - * - * @deprecated Use the call from {@link TransBundle} when available. - */ - static private Locale getLocaleFor(String language) { - Locale locale; - - if (language == null) { - locale = Locale.getDefault(); - } else { - language = language.replaceAll("_", "-"); - String lang = language; - String country = null; - if (language.contains("-")) { - lang = language.split("-")[0]; - country = language.split("-")[1]; - } - - if (country != null) - locale = new Locale(lang, country); - else - locale = new Locale(lang); - } - - return locale; - } }