<strong>[icu]</strong> Returns the fallback locale for this locale.  If this locale is root,
returns null.
351219
public ULocale getFallback() {
        if (localeID.length() == 0 || localeID.charAt(0) == '@') {
            return null;
        }
        return new ULocale(getFallbackString(localeID), (Locale)null);
    }
1230757
public Locale getMainTranslationLocale(Locale defaultValue) {

        Map<String, String> params = getParameters();
        String value = params.get(PARAM_MAIN_LOCALE);
        if (!CmsStringUtil.isEmpty(value)) {
            return CmsLocaleManager.getLocale(value);
        } else {
            return defaultValue;
        }
    }
258083
public Locale getLocale() {
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        processLocales();
        // 321485
        Locale locale = (Locale) (_srtRequestHelper._locales.size() > 0 ? _srtRequestHelper._locales.get(0) : null);
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"getLocale", "this->"+this+": "+" locale --> " + (locale!=null?locale.toString():""));
        }
        return locale;
    }
261295
def fallback_to_default(localization_key, localization)
      localization_key.localizations.where.not(default_value: nil). \
        where.not(id: localization.id).first&.default_value
    end
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;
        }
    }
1126595
protected Locale getLocaleToApply() {
		Locale currentLocale = locale;

		if (currentLocale == null) {
			currentLocale = control.getFallbackLocale();
		}
		return currentLocale;
	}
489026
public Locale getLocale()
    {
        String strLanguage = this.getProperty(Params.LANGUAGE);
        if ((strLanguage != null) && (strLanguage.length() > 0))
        {
            Locale locale = Locale.getDefault();
            if (!strLanguage.equalsIgnoreCase(locale.getLanguage()))
                locale = new Locale(strLanguage, "");
            if (locale != null)
            {
                try {
                    Locale.setDefault(locale);
                } catch (java.security.AccessControlException ex) {
                    Util.getLogger().warning("Can't change locale");   // Ignore and continue
                }
            }
        }
        return Locale.getDefault();
    }
46149
protected LocaleResolver resolveLocale() {
        LocaleResolver localeResolver = null;
        String localeResolverBeanId = getSetting(RequestRule.LOCALE_RESOLVER_SETTING_NAME);
        if (localeResolverBeanId != null) {
            localeResolver = getBean(localeResolverBeanId, LocaleResolver.class);
            localeResolver.resolveLocale(getTranslet());
            localeResolver.resolveTimeZone(getTranslet());
        }
        return localeResolver;
    }
901984
public Map<String, Locale> getMainLocale() {

        return CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {

            @SuppressWarnings("synthetic-access")
            public Object transform(Object arg) {

                if (!(arg instanceof String)) {
                    return null;
                }
                String path = (String)arg;
                try {
                    CmsResource res = m_cms.readResource(path);
                    CmsLocaleGroup localeGroup = m_cms.getLocaleGroupService().readLocaleGroup(res);
                    return localeGroup.getMainLocale();
                } catch (Exception e) {
                    LOG.warn(e.getLocalizedMessage(), e);
                    return null;
                }
            }
        });
    }
78206
def i18n_locale_fallbacks_calculate(lc):
    
    log.debug('i18n_locale_fallbacks_calculate( locale="{locale}" ) called'.format(locale=lc))
    locales = []
    lc_original = lc
    while lc:
        locales.append(lc)
        rindex = max([lc.rfind(separator) for separator in ['@', '_', '-', '.']])
        if rindex == -1:
            break
        lc = lc[:rindex]
    log.debug('i18n_locale_fallbacks_calculate( lc="{lc}" ) = {locales}'.format(lc=lc_original, locales=locales))
    return locales
1284451
@Nullable
  public String getErrorText (@Nonnull final Locale aContentLocale)
  {
    return m_eError == null ? null : m_eError.getDisplayTextWithArgs (aContentLocale, (Object []) m_aErrorParams);
  }
240847
public function getFallbackLocale(): self
    {
        if ($this->variant !== null) {
            return $this->withVariant(null);
        }

        if ($this->region !== null) {
            return $this->withRegion(null);
        }

        if ($this->script !== null) {
            return $this->withScript(null);
        }

        return $this;
    }
1187661
public static Locale current() {
		Locale current = currentHolder.get();
		if (current == null) {
			current = Locale.getDefault();
			currentHolder.set(current);
		}
		return current;
	}
270834
function findFallbackLocale(locale) {
  const locales = getAvailableLocales();

  for (let i = locale.length - 1; i > 1; i -= 1) {
    const key = locale.substring(0, i);

    if (locales.includes(key)) {
      return key;
    }
  }

  return null;
}
1251589
@Override
    public Locale getLocale() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getLocale();
        return null;
    }
607477
public ULocale getLocale(int index) {
        List<ULocale> lcls = locales;
        if (lcls == null) {
            lcls = guessLocales();
        }
        if (index >= 0 && index < lcls.size()) {
            return lcls.get(index);
        }
        return null;
    }
141193
def load_locale(locale, icu=False):
    
    if locale not in locales:
        raise NotImplementedError("The locale '%s' is not supported" % locale)
    if locale not in __locale_caches:
        mod = __import__(__name__, fromlist=[locale], level=0)
        __locale_caches[locale] = getattr(mod, locale)
    return __locale_caches[locale]