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 .