code: public String format( String key, Object[] args )
      {
          try
          {
              String pattern = getPatternString( key );
              StringBuffer buff = new StringBuffer( key.length() + SPAN );
              MessageFormat messFormat = new MessageFormat( pattern, m_locale );
              messFormat.format( args, buff, null );
              String result = buff.toString();
              buff.setLength( 0 );
              return result;
          }
          catch( MissingResourceException mre )
          {
              StringBuffer sb = new StringBuffer();
              sb.append( "Unknown resource. Bundle: '" );
              sb.append( m_baseName );
              sb.append( "' Key: '" );
              sb.append( key );
              sb.append( "' Args: '" );
  
              for( int i = 0; i < args.length; i++ )
              {
                  if( 0 != i )
                  {
                      sb.append( "', '" );
                  }
                  sb.append( args[ i ] );
              }
  
              sb.append( "' Reason: " );
              sb.append( mre );
  
              return sb.toString();
          }
      }
docs: Retrieve a string from resource bundle and format it with specified args.
  
  @param key  the key for resource
  @param args an array of args
  
  @return the formatted string