public static function getParent($locale)
    {
        $parent = null;
        if (isset(self::$parents[$locale])) {
            $parent = self::$parents[$locale];
        } elseif (strpos($locale, '-') !== false) {
            $localeParts = explode('-', $locale);
            array_pop($localeParts);
            $parent = implode('-', $localeParts);
        }
        // The library doesn't have data for the empty 'root' locale, it
        // is more user friendly to use the configured fallback instead.
        if ($parent == 'root') {
            $parent = null;
        }

        return $parent;
    }
public static function getParent($locale)
    {
        $parent = null;
        if (isset(self::$parents[$locale])) {
            $parent = self::$parents[$locale];
        } elseif (strpos($locale, '-') !== false) {
            $localeParts = explode('-', $locale);
            array_pop($localeParts);
            $parent = implode('-', $localeParts);
        }
        // The library doesn't have data for the empty 'root' locale, it
        // is more user friendly to use the configured fallback instead.
        if ($parent == 'root') {
            $parent = null;
        }

        return $parent;
    }
public static function getParent ( $ locale ) { $ parent = null ; if ( isset ( self :: $ parents [ $ locale ] ) ) { $ parent = self :: $ parents [ $ locale ] ; } elseif ( strpos ( $ locale , '-' ) !== false ) { $ localeParts = explode ( '-' , $ locale ) ; array_pop ( $ localeParts ) ; $ parent = implode ( '-' , $ localeParts ) ; } // The library doesn't have data for the empty 'root' locale, it // is more user friendly to use the configured fallback instead. if ( $ parent == 'root' ) { $ parent = null ; } return $ parent ; }
Gets the parent for the given locale.

@param string $locale
The locale.

@return string|null
The parent, or null if none found.
Gets the parent for the given locale .