src/LanguageLoader.php
public static function language($code, $hydrate = true)
    {
        $code = mb_strtolower($code);

        if (! isset(static::$languages)) {
            static::$languages = json_decode(static::getFile(__DIR__.'/../resources/languages.json'), true);
        }

        if (! isset(static::$languages[$code])) {
            throw LanguageLoaderException::invalidLanguage();
        }

        return $hydrate ? new Language(static::$languages[$code]) : static::$languages[$code];
    }
public static function language($code, $hydrate = true)
    {
        $code = mb_strtolower($code);

        if (! isset(static::$languages)) {
            static::$languages = json_decode(static::getFile(__DIR__.'/../resources/languages.json'), true);
        }

        if (! isset(static::$languages[$code])) {
            throw LanguageLoaderException::invalidLanguage();
        }

        return $hydrate ? new Language(static::$languages[$code]) : static::$languages[$code];
    }
public static function language ( $ code , $ hydrate = true ) { $ code = mb_strtolower ( $ code ) ; if ( ! isset ( static :: $ languages ) ) { static :: $ languages = json_decode ( static :: getFile ( __DIR__ . '/../resources/languages.json' ) , true ) ; } if ( ! isset ( static :: $ languages [ $ code ] ) ) { throw LanguageLoaderException :: invalidLanguage ( ) ; } return $ hydrate ? new Language ( static :: $ languages [ $ code ] ) : static :: $ languages [ $ code ] ; }
Get the language by it's ISO ISO 639-1 code.

@param string $code
@param bool   $hydrate

@throws \Rinvex\Language\LanguageLoaderException

@return \Rinvex\Language\Language|array
Get the language by it s ISO ISO 639 - 1 code .