Returns list of calendar formats for ISO formatting.

@param string|null $locale current locale used if null

@return array
489553
public function getCalendarFormats($locale = null)
    {
        return [
            'sameDay' => $this->getTranslationMessage('calendar.sameDay', $locale, '[Today at] LT'),
            'nextDay' => $this->getTranslationMessage('calendar.nextDay', $locale, '[Tomorrow at] LT'),
            'nextWeek' => $this->getTranslationMessage('calendar.nextWeek', $locale, 'dddd [at] LT'),
            'lastDay' => $this->getTranslationMessage('calendar.lastDay', $locale, '[Yesterday at] LT'),
            'lastWeek' => $this->getTranslationMessage('calendar.lastWeek', $locale, '[Last] dddd [at] LT'),
            'sameElse' => $this->getTranslationMessage('calendar.sameElse', $locale, 'L'),
        ];
    }
1134584
public function getAll($locale)
    {
        $qb = $this->createQueryBuilder('r');

        $qb->addSelect('t');
        $qb->innerJoin('r.translations', 't');
        $qb->andWhere('t.locale=:locale');
        $qb->setParameter(':locale', $locale);

        return $qb->getQuery()->execute();
    }
170301
public function getTotalRecurringTaxesFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->getTotalRecurringTaxes(), null, $locale);
    }
43438
public function getTotalTaxesFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->getTotalTaxes(), null, $locale);
    }
929795
protected function getDocuments($locale)
    {
        $propertyEncoder = $this->getContainer()->get('sulu_document_manager.property_encoder');
        $documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');

        $sql2 = sprintf(
            'SELECT * FROM [nt:unstructured] AS a WHERE [jcr:mixinTypes] = "sulu:article" AND [%s] IS NOT NULL',
            $propertyEncoder->localizedSystemName('template', $locale)
        );

        return $documentManager->createQuery($sql2, $locale, ['load_ghost_content' => false])->execute();
    }
266705
private static function getFallbackList($locale)
    {
        $fallbackList = [];

        // Add different locale variations
        $fallbackList[] = strtolower(str_replace('_', '-', $locale));
        $fallbackList[] = str_replace('_', '-', $locale);
        $fallbackList[] = strtolower(str_replace('-', '_', $locale));
        $fallbackList[] = str_replace('-', '_', $locale);

        // Add plain language (without country)
        $fallbackList[] = explode('_', str_replace('-', '_', $locale))[0];

        // Remove unique and reset index
        $fallbackList = array_values(array_unique($fallbackList));

        return $fallbackList;
    }
1322789
protected function getFormFieldName($locale = null)
    {
        if ( ! $locale) {
            return $this->field->key();
        }

        return $this->field->key() . '[' . $locale . ']';
    }
299328
public static function all($locale = null)
    {
        return static::keys()->mapWithKeys(function ($key) use ($locale) {
            return [$key => trans("blog::posts.statuses.{$key}", [], $locale)];
        });
    }
912637
public static String[] getMonths(Locale locale) {
		if (locale == null) {
			locale = Locale.US;
		}
		DateFormatSymbols dfs = DateFormatSymbols.getInstance(locale);
		return dfs.getMonths();
	}
511573
public static function getAllCountriesForLocale($locale)
    {
        $dataDir = __DIR__ . DIRECTORY_SEPARATOR . static::$dataDir;
        $regionList = require $dataDir . '_list.php';

        if (!isset($regionList[$locale])) {
            throw new \RuntimeException("Locale is not supported");
        }

        /*
         * Loop through each part of the $locale, and load data for that locale
         *
         * E.g zh-Hans-HK will look for zh-Hanks-HK, zh-Hanks, then finally zh
         */
        $fallbackParts = explode('-', str_replace('_', '-', $locale));
        $filesToSearch = array();

        $i = count($fallbackParts);
        while ($i > 0) {
            $searchLocale = strtolower(implode('-', $fallbackParts));

            if (isset($regionList[$searchLocale])) {
                $filesToSearch[] = $searchLocale;
            }

            array_pop($fallbackParts);
            $i--;
        }

        /*
         * Load data files, and load the region (if it exists) from it
         */

        $returnData = array();

        foreach ($filesToSearch as $fileToSearch) {
            // Load data file
            $data = require $dataDir . $fileToSearch . '.php';

            $returnData += $data;
        }

        ksort($returnData);

        return $returnData;
    }
1127827
public function getTranslation($locale)
    {
        /** @var TaxClassTranslation $translation */
        foreach ($this->getTranslations() as $translation) {
            if ($translation->getLocale() === $locale) {
                return $translation;
            }
        }

        return null;
    }
250118
protected function getFormatter($locale) {
		if (! isset($this->formatters[$locale])) {
			$this->formatters[$locale] = new NumberFormatter($locale, NumberFormatter::CURRENCY);
		}
		
		return $this->formatters[$locale];
	}
932345
public static function getListForLocale($locale)
    {
        $translation_list_en = array();
        $translation_list_locale = array();
        $result = array();

        $translation_list = TranslationQuery::create()->joinWithI18n('en')->find();

        foreach ($translation_list as $translation_item) {
            /** @var Translation $translation_item */
            $translation_list_en[$translation_item->getId()]['alias'] = $translation_item->getAlias();
            $translation_list_en[$translation_item->getId()]['title'] = $translation_item->getTitle();
        }

        $translation_list = TranslationQuery::create()->joinWithI18n($locale)->find();
        foreach ($translation_list as $translation_item) {
            /** @var Translation $translation_item */
            $translation_list_locale[$translation_item->getId()] = $translation_item->getTitle();
        }

        foreach ($translation_list_en as $id => $translation_item) {
            $result[$translation_item['alias']] = isset($translation_list_locale[$id]) && $translation_list_locale[$id] ?
                $translation_list_locale[$id] :
                ($translation_item['title'] ? $translation_item['title'] : $translation_item['alias']);
        }

        return $result;
    }
348157
public function getDeliveryCostFormatted($locale = null)
    {
        $formatter = $this->getFormatter($locale);

        return $formatter->format((float)$this->entity->getDeliveryCost());
    }
153800
protected function getDatabaseTranslations(Locale $locale)
    {
        $messages   = [];
        $collection = $this->repository->getCollection();
        
        $collection->map(function (Dictionary $dictionary) use ($locale, &$messages) {
            $messages[$dictionary->getIdentifier()] = $dictionary->translate($locale->getCode())->getValue();
        });
        
        return $messages;
    }
1080078
public function getPluralForms(Locale $locale)
    {
        if (!isset($this->rulesetsIndices[$locale->getLanguage()])) {
            return [self::RULE_OTHER];
        }

        $ruleset = $this->rulesets[$locale->getLanguage()][$this->rulesetsIndices[$locale->getLanguage()]] ?? null;

        if ($ruleset === null) {
            return [self::RULE_OTHER];
        }

        return array_merge(array_keys($ruleset), [self::RULE_OTHER]);
    }
32566
public function getTranslation(string $locale): ?string
    {
        if (! isset($this->text[$locale])) {
            $fallback = config('app.fallback_locale');

            return $this->text[$fallback] ?? null;
        }

        return $this->text[$locale];
    }