Do find the localized asset.

@param string $locale
@param string $asset

@return string[]
353438
protected function doFindLocalizedAsset($locale, $asset)
    {
        if (isset($this->assets[$locale][$asset])) {
            return $this->assets[$locale][$asset];
        }

        if (0 < $pos = strpos($locale, '_')) {
            return $this->doFindLocalizedAsset(substr($locale, 0, $pos), $asset);
        }

        return [];
    }
1312260
public function getIsoFormats($locale = null)
    {
        return [
            'LT' => $this->getTranslationMessage('formats.LT', $locale, 'h:mm A'),
            'LTS' => $this->getTranslationMessage('formats.LTS', $locale, 'h:mm:ss A'),
            'L' => $this->getTranslationMessage('formats.L', $locale, 'MM/DD/YYYY'),
            'LL' => $this->getTranslationMessage('formats.LL', $locale, 'MMMM D, YYYY'),
            'LLL' => $this->getTranslationMessage('formats.LLL', $locale, 'MMMM D, YYYY h:mm A'),
            'LLLL' => $this->getTranslationMessage('formats.LLLL', $locale, 'dddd, MMMM D, YYYY h:mm A'),
        ];
    }
546263
public function findAll($locale)
    {
        $units = $this->unitRepository->findAllByLocale($locale);

        array_walk(
            $units,
            function (&$unit) use ($locale) {
                $unit = new Unit($unit, $locale);
            }
        );

        return $units;
    }
1168948
public function findAllByLocale($locale)
    {
        try {
            $qb = $this->getStatusQuery($locale);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
227783
protected function getMessages(string $locale = "en"):array
    {
        $path = __DIR__ . "/../Messages/" . $locale . "/messages.json";

        if (file_exists($path)) {
            $jsonMessages = file_get_contents($path);

            return json_decode($jsonMessages, true);
        }

        return [];
    }
1315186
public function localize_assets( $str ) {

		$str['Add translation']     = __( 'Add translation', 'pods' );
		$str['Toggle translations'] = __( 'Toggle translations', 'pods' );
		$str['Show translations']   = __( 'Show translations', 'pods' );
		$str['Hide translations']   = __( 'Hide translations', 'pods' );
		$str['Select']              = __( 'Select', 'pods' );

		return $str;
	}
263658
public function getTranslatedPropertyNameAssoc($locale, $mapping)
    {
        return [
            'property'   => $this->getTranslatedPropertyName($locale, $mapping['property']),
            'assoc'      => $this->getTranslatedPropertyName($locale, $mapping['assoc']),
            'assocNulls' => $this->getTranslatedPropertyName($locale, $mapping['assocNulls']),
        ];
    }
283264
public function getDefaultResourceForLocale( $locale )
    {
        $resource = null;

        if( $this->getValue() && !$this->getValue()->isEmpty() )
        {
            foreach( $this->getValue() as $index => $item )
            {
                if( $item->{$this->getModel()->getLocaleKey()} === $locale )
                {
                    $resource = $item;
                }
            }
        }

        return $resource;
    }
1034771
public function findAllByLocale($locale, $filter = array())
    {
        if (empty($filter)) {
            $items = $this->itemRepository->findAllByLocale($locale);
        } else {
            $items = $this->itemRepository->findByLocaleAndFilter($locale, $filter);
        }

        array_walk(
            $items,
            function (&$item) use ($locale) {
                $item = $this->itemFactory->createApiEntity($item, $locale);
            }
        );

        return $items;
    }
840489
private function getProductUnits($locale)
    {
        /** @var Unit[] $productUnits */
        $productUnits = $this->get('sulu_product.unit_repository')->findAllByLocale($locale);

        $result = [];

        foreach ($productUnits as $productUnit) {
            $result[] = [
                'id' => $productUnit->getId(),
                'name' => $productUnit->getTranslation($locale)->getName(),
            ];
        }

        return $result;
    }
741162
public static function getStaticLanguageStrings( string $locale = 'en_US', string $version = null ) : array
	{
		$url = self::getStaticDataFileUrl(self::STATIC_LANGUAGESTRINGS, null, $locale, $version);
		return self::loadStaticData($url);
	}
808979
private function getTranslationFilesFromConfiguration($domain, $locale)
    {
        $filteredFilenames = array();

        foreach ($this->translationFilesByLocale as $localeFromConfig => $resourceFilePaths) {
            foreach ($resourceFilePaths as $filename) {
                list($currentDomain, $currentLocale) = explode('.', basename($filename), 3);

                if ($currentDomain === $domain && $currentLocale === $locale) {
                    $filteredFilenames[] = $filename;
                }
            }
        }
        return $filteredFilenames;
    }
777456
protected function parseLocale($locale)
	{
		if ( ! is_null($locale))
		{
			return array_filter(array($locale, $this->fallback));
		}
		else
		{
			return array_filter(array($this->locale, $this->fallback));
		}
	}
389845
public function getFieldDescriptors($locale)
    {
        if ($locale !== $this->currentLocale) {
            $this->initializeFieldDescriptors($locale);
        }

        return $this->fieldDescriptors;
    }
797950
public function getLocalization($locale)
    {
        $dataCollection = $this->getLocalizations();
        $data = $dataCollection->get($locale);

        return $data;
    }
791050
public function findAll($locale, $filter = null)
    {
        if ($filter) {
            $accountEntities = $this->accountRepository->findByFilter($filter);
        } else {
            $accountEntities = $this->accountRepository->findAll();
        }

        if (!empty($accountEntities)) {
            $accounts = [];
            foreach ($accountEntities as $account) {
                $accounts[] = $this->getApiObject($account, $locale);
            }

            return $accounts;
        }

        return;
    }
754631
protected function matchLocaleInAvailableLanguages($locale)
    {
        foreach ($this->availableLanguages as $language) {
            // browser accept language matches an available language
            if ($locale == $language['locale']) {
                return $language['locale'];
            }
            // first part of browser accept language matches an available language
            if (substr($locale, 0, 2) == substr($language['locale'], 0, 2)) {
                return $language['locale'];
            }
        }

        return false;
    }