src/Panda/Localization/Helpers/LocaleHelper.php
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;
    }
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;
    }
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 ; }
Get a locale fallback list to check while translating.

@param string $locale
@param string $fallbackLocale

@return array

@throws InvalidArgumentException
Get a locale fallback list to check while translating .