diff options
author | Emil Ivov <emcho@jitsi.org> | 2008-07-21 14:34:23 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2008-07-21 14:34:23 +0000 |
commit | 1228778d575c06df052ba22dbe78768727507edb (patch) | |
tree | fc850eb4cd74386f5f2c4f1f1cbce517ff5b2c00 /src/net/java/sip/communicator/impl/resources | |
parent | 378e08367e8e6cd139afa967ded8cd84234180c1 (diff) | |
download | jitsi-1228778d575c06df052ba22dbe78768727507edb.zip jitsi-1228778d575c06df052ba22dbe78768727507edb.tar.gz jitsi-1228778d575c06df052ba22dbe78768727507edb.tar.bz2 |
Fix a problem with new mail notifications in yahoo.
Diffstat (limited to 'src/net/java/sip/communicator/impl/resources')
-rw-r--r-- | src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java | 45 |
1 files changed, 14 insertions, 31 deletions
diff --git a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java index 7e69826..59bfd32 100644 --- a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java +++ b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java @@ -270,7 +270,8 @@ public class ResourceManagementServiceImpl /** * Loads a stream from a given identifier. * - * @param streamKey The identifier of the stream. + * @param path The path to the image from a location that's present in the + * classpath. * @return The stream for the given identifier. */ public InputStream getImageInputStreamForPath(String path) @@ -342,34 +343,13 @@ public class ResourceManagementServiceImpl * Returns an internationalized string corresponding to the given key. * * @param key The key of the string. - * @param l The locale. + * @param locale The locale. * @return An internationalized string corresponding to the given key and * given locale. */ - public String getI18NString(String key, Locale l) + public String getI18NString(String key, Locale locale) { - ResourceBundle resourceBundle - = getResourceBundle(languagePack, l); - - String resourceString = findString(key, resourceBundle); - - if (resourceString == null) - { - logger.warn("Missing resource for key: " + key); - return '!' + key + '!'; - } - - int mnemonicIndex = resourceString.indexOf('&'); - - if (mnemonicIndex > -1) - { - String firstPart = resourceString.substring(0, mnemonicIndex); - String secondPart = resourceString.substring(mnemonicIndex + 1); - - resourceString = firstPart.concat(secondPart); - } - - return resourceString; + return getI18NString(key, null, locale); } /** @@ -387,13 +367,13 @@ public class ResourceManagementServiceImpl * Returns an internationalized string corresponding to the given key. * * @param key The key of the string. - * @param l The locale. + * @param locale The locale. * @return An internationalized string corresponding to the given key. */ - public String getI18NString(String key, String[] params, Locale l) + public String getI18NString(String key, String[] params, Locale locale) { ResourceBundle resourceBundle - = getResourceBundle(languagePack, l); + = getResourceBundle(languagePack, locale); String resourceString = findString(key, resourceBundle); @@ -413,7 +393,9 @@ public class ResourceManagementServiceImpl resourceString = firstPart.concat(secondPart); } - resourceString = MessageFormat.format(resourceString, (Object[])params); + if(params != null) + resourceString + = MessageFormat.format(resourceString, (Object[])params); return resourceString; } @@ -433,12 +415,13 @@ public class ResourceManagementServiceImpl * Returns an internationalized string corresponding to the given key. * * @param key The key of the string. + * @param locale The locale that we'd like to receive the result in. * @return An internationalized string corresponding to the given key. */ - public char getI18nMnemonic(String key, Locale l) + public char getI18nMnemonic(String key, Locale locale) { ResourceBundle resourceBundle - = getResourceBundle(languagePack, l); + = getResourceBundle(languagePack, locale); String resourceString = findString(key, resourceBundle); |