Get displayed name

@param   string  $locale
@return  string
502131
public function getDisplayedName( $locale = self::FALLBACK_LOCALE )
    {
        if ( ! empty( $this->displayName[$locale] ) )
        {
            return $this->displayName[$locale];
        }

        $language = Locale::getPrimaryLanguage( $locale );

        if ( ! empty( $this->displayName[$language] ) )
        {
            return $this->displayName[$language];
        }

        if ( ! empty( $this->displayName[static::FALLBACK_LOCALE] ) )
        {
            return $this->displayName[static::FALLBACK_LOCALE];
        }

        if ( ! empty( $this->description ) && strpos( $this->description, "\n" ) )
        {
            list( $name, $description ) = explode( "\n", $this->description, 2 );
            return $name;
        }

        return $this->name;
    }
186428
public static String getJavaName(Locale locale)
  {
    if (locale == null)
      return null;

    return getJavaName(getMimeName(locale));
  }
836061
public static function formatLocale($locale)
    {
        if (\is_string($locale)) {
            $locale = strtolower($locale);
            $locale = str_replace('-', '_', $locale);
        }

        return $locale;
    }
927597
public function getCountryName($inLocale = null)
    {
        $inLocale = Locale::sanitizeLocale($inLocale, $this->locale);

        return \Locale::getDisplayRegion($this->locale, $inLocale);
    }
584855
static public String getDisplayName(Locale objectLocale, Locale displayLocale) {
        return getShim().getDisplayName(ULocale.forLocale(objectLocale),
                                        ULocale.forLocale(displayLocale));
    }
505079
public function localizedSystemName($name, $locale)
    {
        if (null === $locale) {
            throw new InvalidLocaleException($locale);
        }

        return $this->formatLocalizedName('system_localized', $name, $locale);
    }
533329
public function getTranslationByLocale($locale)
    {
        foreach ($this->getTranslations() as $valueTranslation) {
            if ($valueTranslation->getLocale() === $locale) {
                return $valueTranslation;
            }
        }

        return null;
    }
56366
protected function lookupLocale(array $locales, string $locale, string $defaultLocale): string
    {
        // for some odd reason locale_lookup returns empty string but not default locale if input locales are empty
        return empty($locales) === true ? $defaultLocale : locale_lookup($locales, $locale, false, $defaultLocale);
    }
677558
protected function normalizeLocale($locale) {
		if ($locale instanceof Locale) {
			$locale = $locale->getPrimaryLanguage();
		}
		
		$underlinePos = strpos($locale, '_');
		
		if ($underlinePos !== false) {
			return substr($locale, 0, $underlinePos);
		}
		
		return $locale;
	}
1057921
public String getName(final Locale locale) {
        return messageResolver.getMessage(locale, String.format("locale.%s.name", hexId));
    }
609874
public function getRouteNameFromPath($uri, $locale)
    {
        $attributes = Url::extractAttributes($uri);
        $uri        = str_replace([url('/'), "/$locale/"], '', $uri);
        $uri        = trim($uri, '/');

        foreach ($this->translatedRoutes as $routeName) {
            $url = Url::substituteAttributes($attributes, $this->translate($routeName));

            if ($url === $uri) return $routeName;
        }

        return false;
    }
831232
public function locale($code, $locale = null)
    {
        $name = Intl::getLocaleBundle()->getLocaleName($code, $locale ?: $this->localeDetector->getLocale());

        return $name ? $this->fixCharset($name) : '';
    }
187759
public function findByLocale($locale)
    {
        // Get sanitized locale
        $locale = Locale::sanitizeLocale($locale);

        return isset($this->available[$locale]) ? $this->available[$locale] : null;
    }
177078
public function getRouteLocalePrefix($locale = null) {
        if (is_null($locale)) {
            $locale = $this->getLocaleFromRoute();
        }
        return $this->getDefaultRoutelocale() === $locale ? ($this->isUsePrefixForDefaultLocale() ? $locale : '') : $locale;
    }
493223
public function getSymbol($locale = null): string
    {
        if (null === $locale) {
            $locale = Yii::$app->formatter->locale;
        }
        $fmt = new NumberFormatter($locale . "@currency={$this->code}", NumberFormatter::CURRENCY);
        $symbol = $fmt->getSymbol(NumberFormatter::CURRENCY_SYMBOL);

        return $symbol;
    }
396330
public function getLocalization($locale)
	{
		$localization = parent::getLocalization($locale);
		
		// Create fake localization if not persisted
		if (is_null($localization)) {
			$localization = $this->createLocalization($locale);
		}
		
		return $localization;
	}
2168
public function lookUpLanguageIdForLocale($locale)
    {
        $locale = $this->normalizeLocale($locale);

        /** @var Model $languageModel */
        $languageModel = static::$cmsLanguageModel;

        $language = $languageModel::where(config('pxlcms.translatable.locale_code_column'), $locale)
            ->remember((config('pxlcms.cache.languages', 15)))
            ->first();

        if (empty($language)) return null;

        return $language->id;
    }