public static String format(final Locale locale, final String text, final Object... args) {
		if (text == null) {
			return null;
		}

		String localisedText = getLocalisedText(locale, text);
		String message = localisedText == null ? text : localisedText;

		if (args != null) {
			try {
				return MessageFormat.format(message, args);
			} catch (IllegalArgumentException e) {
				LOG.error("Invalid message format for message " + message, e);
			}
		}

		return message;
	}
public static String format ( final Locale locale , final String text , final Object ... args ) { if ( text == null ) { return null ; } String localisedText = getLocalisedText ( locale , text ) ; String message = localisedText == null ? text : localisedText ; if ( args != null ) { try { return MessageFormat . format ( message , args ) ; } catch ( IllegalArgumentException e ) { LOG . error ( "Invalid message format for message " + message , e ) ; } } return message ; }
Formats the given text, optionally using locale-specific text.

@param locale The locale to use to look up a message, may be null.
@param text the text / resource bundle key to use.
@param args the message arguments, may be null.
@return the formatted text.