public static String getLocalizedString(String key, List<?> arguments, Locale locale) {
        if (locale == null) {
            locale = JiveGlobals.getLocale();
        }
        try {
            ResourceBundle bundle = ResourceBundle.getBundle(resourceBaseName, locale);
            return getLocalizedString(key, locale, arguments, bundle);
        } catch (MissingResourceException e) {
            if (!locale.equals(JiveGlobals.getLocale())) {
                return getLocalizedString(key, arguments, JiveGlobals.getLocale());
            } else {
                Log.error(e.getMessage());
                return key;
            }
        }
    }
Returns an internationalized string loaded from a resource bundle
substituting the passed in arguments. Substitution is handled using
the {@link java.text.MessageFormat} class.

If the passed in Locale cannot be used to retrieve a localized string,
the locale specified by JiveGlobals.getLocale() will be used instead.

@param key the key to use for retrieving the string from the
     appropriate resource bundle.
@param arguments a list of objects to use which are formatted, then
     inserted into the pattern at the appropriate places.
@param locale the locale to use for retrieving the appropriate
     locale-specific string.
@return the localized string.
xmppserver/src/main/java/org/jivesoftware/util/LocaleUtils.java