Creates function that converts inputs to uppercase using provided {@code locale}

@param locale to use for case conversion
@return the function
775991
public static Function<String, String> toUpperCase(@Nonnull Locale locale) {
        return new ToUpperCaseFunction(checkNotNull(locale));
    }
1208497
public static Currency getInstance(Locale locale) {
        synchronized (localesToCurrencies) {
            if (locale == null) {
                throw new NullPointerException("locale == null");
            }
            Currency currency = localesToCurrencies.get(locale);
            if (currency != null) {
                return currency;
            }

            String currencyCode = ICU.getCurrencyCode(locale);
            if (currencyCode == null) {
                throw new IllegalArgumentException("Unsupported ISO 3166 country: " + locale);
            } else if (currencyCode.equals("XXX")) {
                return null;
            }
            Currency result = getInstance(currencyCode);
            localesToCurrencies.put(locale, result);
            return result;
        }
    }
434923
public static function fromLocale(string $locale): LocaleFormatter
    {
        $formatter = new NumberFormatter((string) $locale, NumberFormatter::CURRENCY);

        return new self($formatter);
    }
1114214
public <T> T getField(String locale, String key) {
    return localize(locale).getField(key);
  }
1291344
@Nullable
  public static String uppercaseFirstChar(String str, Language language) {
    if (language != null && "nl".equals(language.getShortCode()) && str != null && str.toLowerCase().startsWith("ij")) {
      // hack to fix https://github.com/languagetool-org/languagetool/issues/148
      return "IJ" + str.substring(2);
    } else {
      return changeFirstCharCase(str, true);
    }
  }
672592
private static String toLanguageTag(Locale locale) {
        if (locale == null) {
            return null;
        }
        StringBuilder tag = new StringBuilder();

        tag.append(locale.getLanguage().toLowerCase());

        if (!locale.getCountry().isEmpty()) {
            tag.append("-");
            tag.append(locale.getCountry().toUpperCase());
        }

        return tag.toString();
    }
681647
public void setLocale(final String locale) {
        if (locale == null && this.locale == null) {
            return;
        } else if (locale == null) {
            removeChild(this.locale);
            this.locale = null;
        } else if (this.locale == null) {
            this.locale = new KeyValueNode<String>(CommonConstants.CS_LOCALE_TITLE, locale);
            appendChild(this.locale, false);
        } else {
            this.locale.setValue(locale);
        }
    }
1096725
public static Locale parseLocaleString(String locale) {
		String lang = GeneralUtils.isEmpty(locale) ? "pt" : locale.substring(0, 2);
		String country = GeneralUtils.isEmpty(locale) ? "" : locale.substring(3, 5);
		return new Locale(lang, country);
	}
302777
protected String parseObjectToString(Object object, Locale locale, Arguments args)
    {
        final String string = String.valueOf(object);
        if (args.has(LOWERCASE_FLAG))
        {
            return string.toLowerCase(locale);
        }
        if (args.has(UPPERCASE_FLAG))
        {
            return string.toUpperCase(locale);
        }
        return string;
    }
548113
static String capitalizeFirstLetterOfString(String text, Locale locale) {
        if (text == null || text.length() < 1) {
            return text;
        }
        String textCapitalized = text.substring(0, 1).toUpperCase(locale) + text.substring(1);
        return textCapitalized;
    }
304201
public static MonetaryAmountDecimalFormatBuilder of(Locale locale) {
        MonetaryAmountDecimalFormatBuilder builder = new MonetaryAmountDecimalFormatBuilder();
        builder.decimalFormat = (DecimalFormat) NumberFormat.getCurrencyInstance(locale);
        builder.locale = locale;
        return builder;
    }
630481
public String getLang(final Locale locale, final String key) {
        return langs.get(locale.toString()).getProperty(key);
    }
1009411
public String getLocaleName(final Locale locale) {
        return messageResolver.getMessage(locale, String.format("color.%d.name", index));
    }
561648
public String getFormatStringWithoutDefaulting(Locale locale, String key) {
        for (String s : toStrings(locale)) {
            String msg = get(s).getProperty(key);
            if(msg!=null && msg.length()>0)
                return msg;
        }
        return null;
    }
72288
protected String toLocaleString(Locale locale) {
		String language = locale.getLanguage();
		if(language.isEmpty()) return "";

		String country = locale.getCountry();
		if(country.isEmpty()) return language;

		String variant = locale.getVariant();
		if(variant.isEmpty()) {
			return language + '-' + country;
		} else {
			return language + '-' + country + '-' + variant;
		}
	}
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;
   }
1352910
public SoapFault locale(String locale) {
        LocaleEditor localeEditor = new LocaleEditor();
        localeEditor.setAsText(locale);
        this.locale = (Locale) localeEditor.getValue();
        return this;
    }