Returns the Java name for the given locale.

@param locale the locale to use

@return Java encoding name
186428
public static String getJavaName(Locale locale)
  {
    if (locale == null)
      return null;

    return getJavaName(getMimeName(locale));
  }
630481
public String getLang(final Locale locale, final String key) {
        return langs.get(locale.toString()).getProperty(key);
    }
1305359
public static String getRegion(Locale locale) {

        String region = locale.getUnicodeLocaleType("rg");

        if ((region != null) && (region.length() == 6)) {
            String upper = region.toUpperCase(Locale.US);
            if (upper.endsWith("ZZZZ")) {
                return upper.substring(0, 2);
            }
        }

        return locale.getCountry();

    }
592560
public static List<Locale> getCandidateLocales(Locale locale) {

        String language = LanguageMatch.getAlias(locale);
        String country = FormatUtils.getRegion(locale);
        String variant = locale.getVariant();

        if (language.equals("zh") && locale.getScript().equals("Hant")) {
            country = "TW";
        }

        List<Locale> list = new LinkedList<>();

        if (!variant.isEmpty()) {
            list.add(new Locale(language, country, variant));
        }

        if (!country.isEmpty()) {
            list.add(new Locale(language, country, ""));
        }

        if (!language.isEmpty()) {
            list.add(new Locale(language, "", ""));
            if (language.equals("nn")) {
                list.add(new Locale("nb", "", ""));
            }
        }

        list.add(Locale.ROOT);
        return list;

    }
81356
public static String getMimeName(Locale locale)
  {
    if (locale == null)
      return "utf-8";

    String mimeName = _localeName.get(locale.toString());
    if (mimeName == null)
      mimeName = _localeName.get(locale.getLanguage());

    if (mimeName == null)
      return "utf-8";
    else
      return mimeName;
  }
505079
public function localizedSystemName($name, $locale)
    {
        if (null === $locale) {
            throw new InvalidLocaleException($locale);
        }

        return $this->formatLocalizedName('system_localized', $name, $locale);
    }
1223683
String getLocalName() {

        if (!locale_set) {
            setLocale(Locale.getDefault());
        }

        String key = this.getTypeName();

        return BundleHandler.getString(hnd_local_names, key);
    }
381257
@Nullable
  private Language getLanguageForLocalizedName(String languageName) {
    for (Language element : Languages.get()) {
      if (languageName.equals(element.getTranslatedName(messages))) {
        return element;
      }
    }
    return null;
  }
660423
private static String generateName(Locale locale) {
    StringBuilder str = new StringBuilder();
    str.append("models_").append(locale.getLanguage());

    if (locale.getCountry() != null && !locale.getCountry().isEmpty())
      str.append("_").append(locale.getCountry());

    str.append(".xml");

    return str.toString();
  }
382313
public String getDisplayName(Locale locale) {

        if (getParentFqn() == null) {
            // for the root ou
            return getDescription(locale);
        }
        return Messages.get().getBundle(locale).key(
            Messages.GUI_ORGUNIT_DISPLAY_NAME_2,
            getDescription(locale),
            CmsOrganizationalUnit.SEPARATOR + getName());
    }
1331776
public static TimeZoneGenericNames getInstance(ULocale locale) {
        String key = locale.getBaseName();
        return GENERIC_NAMES_CACHE.getInstance(key, locale);
    }
1107442
@Override
    public Locale getLocale() {
        if (null == this.locales) {
            this.locales = connection.getEncodingUtils().getLocales(this.request.getHeader("Accept-Language"));
        }
        if (this.locales.isEmpty()) {
            return null;
        }
        return this.locales.get(0);
    }
228850
public static final char getChar(Locale locale, String key)
   {
      ResourceBundle bundle = ResourceBundle.getBundle(LocaleData.class.getName(), locale);
      return (bundle.getString(key).charAt(0));
   }
629645
public static String getName(String localeID){
        String tmpLocaleID;
        // Convert BCP47 id if necessary
        if (localeID != null && !localeID.contains("@") && getShortestSubtagLength(localeID) == 1) {
            tmpLocaleID = forLanguageTag(localeID).getName();
            if (tmpLocaleID.length() == 0) {
                tmpLocaleID = localeID;
            }
        } else {
            tmpLocaleID = localeID;
        }
        return nameCache.getInstance(tmpLocaleID, null /* unused */);
    }
1181162
public static final String getLocaleExtendedName(String lookup, Locale locale) {

        if (locale == null) {
            return lookup;
        }
        return getLocaleExtendedName(lookup, locale.toString());
    }
512432
static GJLocaleSymbols forLocale(Locale locale) {
        if (locale == null) {
            locale = Locale.getDefault();
        }
        GJLocaleSymbols symbols = cCache.get(locale);
        if (symbols == null) {
            symbols = new GJLocaleSymbols(locale);
            GJLocaleSymbols oldSymbols = cCache.putIfAbsent(locale, symbols);
            if (oldSymbols != null) {
                symbols = oldSymbols;
            }
        }
        return symbols;
    }
1042925
public static Locale getLocaleFromName(String name) {
        String language = "";
        String country = "";
        String variant = "";

        int i1 = name.indexOf('_');
        if (i1 < 0) {
            language = name;
        } else {
            language = name.substring(0, i1);
            ++i1;
            int i2 = name.indexOf('_', i1);
            if (i2 < 0) {
                country = name.substring(i1);
            } else {
                country = name.substring(i1, i2);
                variant = name.substring(i2+1);
            }
        }

        return new Locale(language, country, variant);
    }