Format a message given a resource string name <code>key</code> and a set of
formatting arguments <code>args</code>.
@param key the message key
@param args the arguments used when formatting the message
@return the formatted message
770798
public String formatMessage(String key, Object[] args) {
        assert _resourceProvider != null : "Received a null resource provider";
        return _resourceProvider.formatMessage(key, args);
    }
843437
public String _(String key, Object... args) {
//        JellyBuilder b = (JellyBuilder)getDelegate();

        ResourceBundle resourceBundle = getResourceBundle();

        // notify the listener if set
//        InternationalizedStringExpressionListener listener = (InternationalizedStringExpressionListener) Stapler.getCurrentRequest().getAttribute(LISTENER_NAME);
//        if(listener!=null)
//            listener.onUsed(this, args);

        args = Stapler.htmlSafeArguments(args);

        return resourceBundle.format(LocaleProvider.getLocale(), key, args);
    }
284917
public static Message error(Entity entity, String key, String... args) {
        return message(MessageType.ERROR, entity, key, args);
    }
1072663
protected String formatMessage(String message, Object[] parameters) {
        String formatted;
        if (printfStyle) {
            formatted = String.format(message, parameters);
        } else {
            formatted = MessageFormat.format(message, parameters);
        }
        return formatted;
    }
278546
static String getFormattedString(String key, Object... arguments) {
		return I18N.getFormattedString(key, arguments);
	}
1304748
public static String getText(String key, ResourceBundle bundle, Object... arguments)
	{
		try
		{
			String value = bundle.getString(key);

			return MessageFormat.format(value, arguments);
		}
		catch (MissingResourceException ex)
		{
			return key;
		}
	}
157842
public static String format(String format, Object... args) {
		if (format != null && args != null && args.length > 0) {
			try {
				return String.format(format, args);
			} catch (Exception e) {
				android.util.Log.e("Apptentive", "Error while formatting String: " + e.getMessage()); // TODO: better system logging
			}
		}

		return format;
	}
1219695
public String getInvalidMessage(String key) {
        return invalidMessageOverride == null ? messageMixin.lookup(key, messageValueArgs) : MessageFormat.format(
                invalidMessageOverride, messageValueArgs);
    }
51959
protected String message(String key, Object... args) {

        return Messages.get().key(key, args);
    }
257212
@SuppressWarnings("unchecked")
    public <T> T get(String key) {
        return (T) argMap.get(key);
    }
1225038
public String format(String key, Object ... params) {
        ResourceBundle bundle = getBundle();
        if (bundle.containsKey(key)) {
            String msg = bundle.getString(key);
            return MessageFormat.format(msg, params);
        } else {
            return MessageFormat.format("!!{0}!!", key); //$NON-NLS-1$
        }
    }
737817
protected String internalFormatMessage(String pattern, Object[] args) {
        /* todo: perf -- could the MessageFormat objects be cached? */
        MessageFormat format = new MessageFormat(pattern);
        String msg = format.format(args).toString();
        return msg;
    }
1211639
public static final String getMessage(String key, Object... args) {
        return NLS.getFormattedMessage(key, args, key);
    }
295599
static String format(final String messagePattern, final Object[] arguments) {
        final StringBuilder result = new StringBuilder();
        final int argCount = arguments == null ? 0 : arguments.length;
        formatMessage(result, messagePattern, arguments, argCount);
        return result.toString();
    }
1221910
public String get (String key, Object... args)
    {
        // First make the key for GWT-friendly
        return fetch(key.replace('.', '_'), args);
    }
910783
public static String format(String message, Object... formatArgs)
  {
    return String.format(Locale.ENGLISH, message, formatArgs);
  }
697742
public static String compose (String key, Object... args)
    {
        StringBuilder buf = new StringBuilder();
        buf.append(key);
        buf.append('|');
        for (int i = 0; i < args.length; i++) {
            if (i > 0) {
                buf.append('|');
            }
            // escape the string while adding to the buffer
            String arg = (args[i] == null) ? "" : String.valueOf(args[i]);
            int alength = arg.length();
            for (int p = 0; p < alength; p++) {
                char ch = arg.charAt(p);
                if (ch == '|') {
                    buf.append("\\!");
                } else if (ch == '\\') {
                    buf.append("\\\\");
                } else {
                    buf.append(ch);
                }
            }
        }
        return buf.toString();
    }