diff options
author | GunChleoc <fios@foramnagaidhlig.net> | 2014-04-14 15:10:10 +0100 |
---|---|---|
committer | GunChleoc <fios@foramnagaidhlig.net> | 2014-04-14 15:10:10 +0100 |
commit | 6b9b798f963aa86b8ec0ab5fb2780c771f5c9aa5 (patch) | |
tree | d6ba6e05beedc191feded4a68d727e265c60349f /src/net/java/sip/communicator/plugin | |
parent | f344a70f309fc347b032df7092f23c2d4d4be5bc (diff) | |
download | jitsi-6b9b798f963aa86b8ec0ab5fb2780c771f5c9aa5.zip jitsi-6b9b798f963aa86b8ec0ab5fb2780c771f5c9aa5.tar.gz jitsi-6b9b798f963aa86b8ec0ab5fb2780c771f5c9aa5.tar.bz2 |
Spellcheck plugin: Locales now define their flag icon in the XML file.
Diffstat (limited to 'src/net/java/sip/communicator/plugin')
-rw-r--r-- | src/net/java/sip/communicator/plugin/spellcheck/LanguageMenuBar.java | 5 | ||||
-rw-r--r-- | src/net/java/sip/communicator/plugin/spellcheck/Parameters.java | 20 |
2 files changed, 19 insertions, 6 deletions
diff --git a/src/net/java/sip/communicator/plugin/spellcheck/LanguageMenuBar.java b/src/net/java/sip/communicator/plugin/spellcheck/LanguageMenuBar.java index 94f5353..ee2f5a3 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 @@ public class LanguageMenuBar 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 297d5d1..326aea2 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 @@ class Parameters ((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 @@ class Parameters 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; } /** @@ -261,6 +266,17 @@ class Parameters } /** + * 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. * |