diff --git a/resources/config/spellcheck/parameters.xml b/resources/config/spellcheck/parameters.xml index 516250ad1..1d3e1e2e2 100644 --- a/resources/config/spellcheck/parameters.xml +++ b/resources/config/spellcheck/parameters.xml @@ -12,6 +12,7 @@ + ]> @@ -46,98 +47,98 @@ Some missing dictionaries: - - - - + + + + --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/net/java/sip/communicator/plugin/spellcheck/LanguageMenuBar.java b/src/net/java/sip/communicator/plugin/spellcheck/LanguageMenuBar.java index 94f535355..ee2f5a355 100644 --- a/src/net/java/sip/communicator/plugin/spellcheck/LanguageMenuBar.java +++ b/src/net/java/sip/communicator/plugin/spellcheck/LanguageMenuBar.java @@ -281,10 +281,7 @@ else if (!isAvailable && UNAVAILABLE_FLAGS.containsKey(locale)) try { - int commaIndex = locale.getIsoCode().indexOf(","); - String countryCode = - locale.getIsoCode().substring(commaIndex + 1); - localeFlag = Resources.getFlagImage(countryCode); + localeFlag = Resources.getFlagImage(locale.getFlagIcon()); BufferedImage flagBuffer = copy(localeFlag.getImage()); setFaded(flagBuffer); diff --git a/src/net/java/sip/communicator/plugin/spellcheck/Parameters.java b/src/net/java/sip/communicator/plugin/spellcheck/Parameters.java index 297d5d199..326aea26d 100644 --- a/src/net/java/sip/communicator/plugin/spellcheck/Parameters.java +++ b/src/net/java/sip/communicator/plugin/spellcheck/Parameters.java @@ -145,9 +145,11 @@ private static void parseLocales(NodeList list) ((Attr) attributes.getNamedItem("isoCode")).getValue(); String dictLocation = ((Attr) attributes.getNamedItem("dictionaryUrl")).getValue(); + String flagIcon = + ((Attr) attributes.getNamedItem("flagIcon")).getValue(); try { - LOCALES.add(new Locale(label, code, new URL(dictLocation))); + LOCALES.add(new Locale(label, code, new URL(dictLocation), flagIcon)); } catch (MalformedURLException exc) { @@ -206,13 +208,16 @@ public static class Locale private final URL dictLocation; + private final String flagIcon; + private boolean isLoading = false; - private Locale(String label, String isoCode, URL dictLocation) + private Locale(String label, String isoCode, URL dictLocation, String flagIcon) { this.label = label; this.isoCode = isoCode; this.dictLocation = dictLocation; + this.flagIcon = flagIcon; } /** @@ -260,6 +265,17 @@ public URL getDictUrl() return this.dictLocation; } + /** + * Provides the file name of the image files used for the locale's flag, + * without file extension of path. + * + * @return flagIcon of dictionary resource + */ + public String getFlagIcon() + { + return this.flagIcon; + } + /** * Sets the loading property. Indicates if this locale is currently * loaded in the list.