Gets the number format for the provided locale.

@param string $locale The locale.

@return NumberFormat
975322
protected function getNumberFormat($locale)
    {
        if (!isset($this->numberFormats[$locale])) {
            $this->numberFormats[$locale] = $this->numberFormatRepository->get($locale);
        }

        return $this->numberFormats[$locale];
    }
1185231
public function locale($locale = null)
    {
        if ($locale) {
            // Normalize the language
            self::$locale = strtolower(str_replace([' ', '_'], '-', $locale));
        }

        return self::$locale;
    }
1061156
public function uri($locale = null)
    {
        $uri = $this->page->uri($locale).'#'.$this->position.'-'.$this->translate('slug', $locale);

        return $uri;
    }
824247
@Transformer(requireTemplate = true)
    public static String format(Number number, String pattern, Locale locale) {
        return format(null, number, pattern, locale);
    }
164910
public function getLinkingMode($locale)
    {
        if ($this->owner->hasMethod('canViewInLocale') && !$this->owner->canViewInLocale($locale)) {
            return 'invalid';
        }

        if ($locale === FluentState::singleton()->getLocale()) {
            return 'current';
        }

        return 'link';
    }
36168
public function getTotalRecurringNetPriceFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->entity->getTotalRecurringNetPrice(), null, $locale);
    }
325337
private function locale2handle (string $locale): string
	{
		if (
			!preg_match('/^' . HandleValidator::$handlePattern . '$/', $locale) ||
			in_array(strtolower($locale), HandleValidator::$baseReservedWords, true)
		) {
			$localeParts = array_filter(preg_split('/[^a-zA-Z0-9]/', $locale));

			return $localeParts ? '_' . implode('_', $localeParts) : '';
		}

		return $locale;
	}
1264169
private function transformLocale($locale)
    {
        $theme = $this->themeContext->getTheme();

        if (null === $theme) {
            return $locale;
        }

        if (null === $locale) {
            $locale = $this->getLocale();
        }

        $locale = $locale . '@' . str_replace('/', '-', $theme->getName());

        return $locale;
    }
637987
public function getTotalRecurringPriceFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->entity->getTotalRecurringPrice(), null, $locale);
    }
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;
	}
673468
public function getTotalPriceFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->entity->getTotalPrice(), null, $locale);
    }
826476
protected function getLocale($locale)
    {
        $result = null;
        if ($locale instanceof LocaleEntity) {
            $result = $locale;
        } elseif (is_string($locale) && $locale !== '') {
            $result = $this->app->make(LocaleRepository::class)->findApproved($locale);
        }

        return $result;
    }
690270
protected function checkLocale($locale)
    {
        $languageFound = null;
        $language = strstr($locale, '_', true);

        foreach ($this->configuration['locales'] as $availableLocale) {
            // If locale matches, the exact matching was found.
            if ($availableLocale === $locale) {
                return $availableLocale;
            }

            // Check if language (without locale) matches.
            if ($language == $availableLocale) {
                $languageFound = $availableLocale;
            }
        }

        if ($languageFound) {
            return $languageFound;
        }

        return null;
    }
1006623
protected function getTranslationOrNew($locale)
    {
        if (($translation = $this->getTranslation($locale)) === null) {
            $translation = $this->createNewTranslation($locale);
        }

        return $translation;
    }
996340
public function getNetShippingCostsFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->entity->getNetShippingCosts(), null, $locale);
    }
1127827
public function getTranslation($locale)
    {
        /** @var TaxClassTranslation $translation */
        foreach ($this->getTranslations() as $translation) {
            if ($translation->getLocale() === $locale) {
                return $translation;
            }
        }

        return null;
    }
367986
protected function getCountryNameForNumber(PhoneNumber $number, $locale)
    {
        $regionCodes = $this->phoneUtil->getRegionCodesForCountryCode($number->getCountryCode());

        if (count($regionCodes) === 1) {
            return $this->getRegionDisplayName($regionCodes[0], $locale);
        }

        $regionWhereNumberIsValid = 'ZZ';
        foreach ($regionCodes as $regionCode) {
            if ($this->phoneUtil->isValidNumberForRegion($number, $regionCode)) {
                // If the number has already been found valid for one region, then we don't know which
                // region it belongs to so we return nothing.
                if ($regionWhereNumberIsValid !== 'ZZ') {
                    return '';
                }
                $regionWhereNumberIsValid = $regionCode;
            }
        }

        return $this->getRegionDisplayName($regionWhereNumberIsValid, $locale);
    }