From: Niki Roo Date: Mon, 19 Mar 2018 06:40:21 +0000 (+0100) Subject: Update nikiroo-utils to 4.2.0 + remove warnings X-Git-Tag: fanfix-1.7.0~25 X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=commitdiff_plain;h=48f14dc96bd27521e0c36ca227f3f3a2df3e5213 Update nikiroo-utils to 4.2.0 + remove warnings --- diff --git a/changelog.md b/changelog.md index cf94f34..abe445f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # Fanfix -# Version 1.6.4 +# Version WIP - update nikiroo-utils - android: Android compatibility diff --git a/libs/nikiroo-utils-4.0.1-sources.jar b/libs/nikiroo-utils-4.2.0-sources.jar similarity index 76% rename from libs/nikiroo-utils-4.0.1-sources.jar rename to libs/nikiroo-utils-4.2.0-sources.jar index 6618209..2dd080f 100644 Binary files a/libs/nikiroo-utils-4.0.1-sources.jar and b/libs/nikiroo-utils-4.2.0-sources.jar differ diff --git a/src/be/nikiroo/fanfix/VersionCheck.java b/src/be/nikiroo/fanfix/VersionCheck.java index 0045062..76758af 100644 --- a/src/be/nikiroo/fanfix/VersionCheck.java +++ b/src/be/nikiroo/fanfix/VersionCheck.java @@ -110,7 +110,7 @@ public class VersionCheck { if (Instance.isVersionCheckNeeded()) { try { // Prepare the URLs according to the user's language - Locale lang = Instance.getTrans().getLanguage(); + Locale lang = Instance.getTrans().getLocale(); String fr = lang.getLanguage(); String BE = lang.getCountry().replace(".UTF8", ""); String urlFrBE = base.replace("${LANG}", "-" + fr + "_" + BE); diff --git a/src/be/nikiroo/fanfix/bundles/StringIdBundle.java b/src/be/nikiroo/fanfix/bundles/StringIdBundle.java index 0b129e4..e94c05b 100644 --- a/src/be/nikiroo/fanfix/bundles/StringIdBundle.java +++ b/src/be/nikiroo/fanfix/bundles/StringIdBundle.java @@ -2,7 +2,6 @@ package be.nikiroo.fanfix.bundles; import java.io.File; import java.io.IOException; -import java.util.Locale; import be.nikiroo.utils.resources.TransBundle; @@ -12,8 +11,6 @@ import be.nikiroo.utils.resources.TransBundle; * @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). @@ -23,18 +20,6 @@ public class StringIdBundle extends TransBundle { */ 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); } /** @@ -52,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; - } } diff --git a/src/be/nikiroo/fanfix/supported/Text.java b/src/be/nikiroo/fanfix/supported/Text.java index 1437911..25d7899 100644 --- a/src/be/nikiroo/fanfix/supported/Text.java +++ b/src/be/nikiroo/fanfix/supported/Text.java @@ -28,7 +28,7 @@ import be.nikiroo.utils.Progress; * number *
  • A description of the story must be given as chapter number 0
  • *
  • A cover may be present, with the same filename but a PNG, JPEG or JPG - * extension * * * @author niki