<p>
Same as {@link #pluralizeFormat(String)} for the specified locale.
</p>

@param template
String of tokens delimited by '::'
@param locale
Target locale
@return Message instance prepared to generate pluralized strings
437791
public static MessageFormat pluralizeFormat(final String template, final Locale locale)
    {
        return withinLocale(new Callable<MessageFormat>()
        {
            public MessageFormat call() throws Exception
            {
                return pluralizeFormat(template);
            };
        }, locale);
    }
775991
public static Function<String, String> toUpperCase(@Nonnull Locale locale) {
        return new ToUpperCaseFunction(checkNotNull(locale));
    }
626705
public String formatAsString(final Cell cell, final Locale locale) {
        return format(cell, locale).getText();
    }
561111
public static StringTemplate stringTemplate(Template template, Object... args) {
        return stringTemplate(template, ImmutableList.copyOf(args));
    }
432558
public static boolean isRtlLanguage(String locale) {
    try {
      return UScript.isRightToLeft(
          UCharacter.getPropertyValueEnum(
              UProperty.SCRIPT, ULocale.addLikelySubtags(new ULocale(locale)).getScript()));
    } catch (IllegalArgumentException e) {
      return false;
    }
  }
631009
@Override
    public FastStr toUpperCase(Locale locale) {
        String s = toString();
        return unsafeOf(s.toUpperCase(locale));
    }
451598
public static MessageFormat pluralizeFormat(final String pattern, final String... choices)
    {
        double[] indexes = new double[choices.length];

        for (int i = 0; i < choices.length; i++)
        {
            indexes[i] = i;
        }

        ChoiceFormat choiceForm = new ChoiceFormat(indexes, choices);
        MessageFormat format = (MessageFormat) messageFormat(pattern).clone();
        format.setFormat(0, choiceForm);

        return format;
    }
1087152
public static String formatMessage(TraceComponent tc, Locale locale, String msgKey, Object... objs) {
        return formatMessage(tc, (locale == null) ? null : Collections.singletonList(locale), msgKey, objs);
    }
1293719
public static String toUpperCase(String string, Locale locale) {

    if (locale == null) {
      return toUpperCase(string, STANDARD_LOCALE);
    }
    return string.toUpperCase(locale);
  }
910783
public static String format(String message, Object... formatArgs)
  {
    return String.format(Locale.ENGLISH, message, formatArgs);
  }
898268
public CmsUrlNameMappingFilter filterLocale(String locale) {

        if (locale == null) {
            throw new IllegalArgumentException();
        }
        CmsUrlNameMappingFilter result = new CmsUrlNameMappingFilter(this);
        result.m_locale = locale;
        return result;
    }
940561
public PrettyTime setLocale(Locale locale)
   {
      if (locale == null)
         locale = Locale.getDefault();

      this.locale = locale;
      for (TimeUnit unit : units.keySet()) {
         if (unit instanceof LocaleAware)
            ((LocaleAware<?>) unit).setLocale(locale);
      }
      for (TimeFormat format : units.values()) {
         if (format instanceof LocaleAware)
            ((LocaleAware<?>) format).setLocale(locale);
      }
      return this;
   }
1248285
public static StringTemplate stringTemplate(String template, List<?> args) {
        return stringTemplate(createTemplate(template), args);
    }
782557
public Iterable<Di18n> queryByLocalizedMessage(java.lang.String localizedMessage) {
    return queryByField(null, Di18nMapper.Field.LOCALIZEDMESSAGE.getFieldName(), localizedMessage);
  }
1142945
function MessageFormat(message, locales, formats) {
  // Parse string messages into an AST.
  var ast = typeof message === 'string' ? MessageFormat.__parse(message) : message;

  if (!(ast && ast.type === 'messageFormatPattern')) {
    throw new TypeError('A message must be provided as a String or AST.');
  } // Creates a new object with the specified `formats` merged with the default
  // formats.


  formats = this._mergeFormats(MessageFormat.formats, formats); // Defined first because it's used to build the format pattern.

  defineProperty(this, '_locale', {
    value: this._resolveLocale(locales)
  }); // Compile the `ast` to a pattern that is highly optimized for repeated
  // `format()` invocations. **Note:** This passes the `locales` set provided
  // to the constructor instead of just the resolved locale.

  var pluralFn = this._findPluralRuleFunction(this._locale);

  var pattern = this._compilePattern(ast, locales, formats, pluralFn); // "Bind" `format()` method to `this` so it can be passed by reference like
  // the other `Intl` APIs.


  var messageFormat = this;

  this.format = function (values) {
    try {
      return messageFormat._format(pattern, values);
    } catch (e) {
      if (e.variableId) {
        throw new Error('The intl string context variable \'' + e.variableId + '\'' + ' was not provided to the string \'' + message + '\'');
      } else {
        throw e;
      }
    }
  };
}
1315179
def get_template_i18n(template_name, locale):
    """"""
    if locale is None:
        return [template_name]

    template_list = []
    parts = template_name.rsplit(".", 1)
    root = parts[0]
    suffix = parts[1]

    if locale.territory is not None:
        locale_string = "_".join([locale.language, locale.territory])
        localized_template_path = ".".join([root, locale_string, suffix])
        template_list.append(localized_template_path)

    localized_template_path = ".".join([root, locale.language, suffix])
    template_list.append(localized_template_path)

    # append the default
    template_list.append(template_name)
    return template_list
348704
public Template getTemplate(String name, Locale locale, Object args) throws IOException, ParseException {
        if (args instanceof String)
            return getTemplate(name, locale, (String) args);
        return getTemplate(name, locale, null, args);
    }