code: public static String substituteParams(Locale locale, String msgtext, Object params[])
      {
          String localizedStr = null;
          if(params == null || msgtext == null)
          {
              return msgtext;
          }
  
          if(locale != null)
          {
              MessageFormat mf = new MessageFormat(msgtext,locale);            
              localizedStr = mf.format(params);
          }
          return localizedStr;
      }
docs: Uses <code>MessageFormat</code> and the supplied parameters to fill in the param placeholders in the String.
  
  @param locale The <code>Locale</code> to use when performing the substitution.
  @param msgtext The original parameterized String.
  @param params The params to fill in the String with.
  @return The updated String.