Gets the fallback locales.

@return array The fallback locales
8452
public function getFallbackLocales()
    {
        if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) {
            return $this->translator->getFallbackLocales();
        }

        return [];
    }
995708
public function getFallbackLanguages()
    {
        if (empty($this->fallback_languages)) {
            if ($this->enabled()) {
                $fallback_languages = $this->languages;

                if ($this->active) {
                    $active_extension = $this->active;
                    $key = \array_search($active_extension, $fallback_languages, true);
                    unset($fallback_languages[$key]);
                    array_unshift($fallback_languages, $active_extension);
                }
                $this->fallback_languages = $fallback_languages;
            }
            // always add english in case a translation doesn't exist
            $this->fallback_languages[] = 'en';
        }

        return $this->fallback_languages;
    }
546028
public function localizableLocales()
    {
        // Keep only locales that don't exist in ...
        return array_diff_key(
            Config::get('decoy.site.locales'),

            // ... the locales of other localizations ...
            $this->other()->pluck('locale')->flip()->toArray(),

            // ... and the model's locale
            [$this->item->locale => null]
        );
    }
12474
public static function getLocaleFallbackList($locale, $fallbackLocale = '')
    {
        // Check arguments
        if (empty($locale)) {
            throw new InvalidArgumentException(__METHOD__ . ': The given locale is empty');
        }

        // Create a priority fallback list to check for different locale.
        // This list includes also generic language codes separated from locale in case
        // there is generic language fallback.
        // If the base language for current and fallback locale is the same, then the language code
        // goes in the end as final fallback.
        $fallbackList = [];

        // Get fallback for normal locale
        $fallbackList = array_merge($fallbackList, self::getFallbackList($locale));

        // Add fallback locale, if different
        if ($fallbackLocale != $locale) {
            $fallbackList = array_merge($fallbackList, self::getFallbackList($fallbackLocale));
        }

        return $fallbackList;
    }
1283487
public function getLocales()
    {
        $this->start();
        try {
            $this->getUserControl()->checkRateLimit();
            $this->getUserControl()->checkGenericAccess(__FUNCTION__);
            $locales = $this->app->make(LocaleRepository::class)->getApprovedLocales();
            $result = $this->buildJsonResponse($this->localesToArray($locales));
        } catch (Exception $x) {
            $result = $this->buildErrorResponse($x);
        } catch (Throwable $x) {
            $result = $this->buildErrorResponse($x);
        }

        return $this->finish($result);
    }
769768
public function getLocales()
	{
		$currentLocales = array();
		
		foreach($this->localeCategories as $category) {
			if($category === LC_ALL)
				continue;
			
			$currentLocales[$category] = setlocale($category, 0);
		}
		
		return $currentLocales;
	}
878484
public function getCountries()
    {
        if (!array_key_exists(Localization::activeLocale(), $this->countries)) {
            $this->loadCountries();
        }

        return $this->countries[Localization::activeLocale()];
    }
307994
public function getLocale(): string
    {
        if (is_null($this->locale)) {
            $this->locale = \Locale::getDefault();
        }

        return $this->locale;
    }
1067829
public function all()
    {
        $default = $this->data($this->getLocale());
        $fallback = $this->data($this->getFallbackLocale());

        return $default + $fallback;
    }
1291193
protected function parseLocale($locale) {
        if (null == $locale) {
            return [$this->locale, $this->fallback];
        }

        return [$locale, $this->fallback];
    }
1126595
protected Locale getLocaleToApply() {
		Locale currentLocale = locale;

		if (currentLocale == null) {
			currentLocale = control.getFallbackLocale();
		}
		return currentLocale;
	}
338915
public function forLocale($locale, $fallbacks=null)
    {
        $fork = $this->replicate()->setLocale($locale);

        if ($fallbacks) {
            return $fork->setFallbacks($fallbacks);
        }

        if ($this->localeFallbacks) {
            return $fork->setFallbacks($this->localeFallbacks);
        }

        return $fork;
    }
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;
    }
735955
private function getAvailableLocales()
    {
        if (empty($this->availableLocales)) {
            // Open the pages directory.
            $pagesDirectory = opendir('../data/pages/');
            while ($directory = readdir($pagesDirectory)) {
                if (($directory != '.') && ($directory != '..')) {
                    $this->availableLocales[] = $directory;
                }
            }
            closedir($pagesDirectory);
        }

        return $this->availableLocales;
    }
1116082
public function localizations()
    {
        if ($this->localizations === null) {
            $this->setLocalizations($this->defaultLocalizations());
        }

        return $this->localizations;
    }
996414
public function getSupportedLocales()
    {
        $return = [];
        $process = new Process(['locale', '-a']);
        $process->run();
        $installedLocales = explode(PHP_EOL, trim($process->getOutput()));
        foreach ($this->supportedLocales as $supportedLocale) {
            if (in_array($supportedLocale, $installedLocales)
                || in_array($supportedLocale.'.utf8', $installedLocales)
            ) {
                $return[] = new Locale($supportedLocale);
            }
        }

        return $return;
    }
151340
public function getSourceLocale()
    {
        $sourceLocale = $this->owner->getField('SourceLocale');
        if ($sourceLocale) {
            return Locale::getByLocale($sourceLocale);
        }
        return Locale::getDefault();
    }