public static function registerTranslations($baseDir, $localesDir, $prefix = null)
    {
        if (self::$isInit === true) {
            $dir = $baseDir . DIRECTORY_SEPARATOR . $localesDir;
            if (is_dir($dir) === false) {
                throw new InvalidDirectory('directory "' . $dir . '" can\'t be identified');
            }
            $language = self::$currentLanguage;
            if (($pos = strpos($language, '-')) !== false) {
                $pos = (int) $pos; // re: https://github.com/phpstan/phpstan/issues/647
                $language = substr($language, 0, $pos);
            }
            if (($pos = strpos($language, '_')) !== false) {
                $pos = (int) $pos; // re: https://github.com/phpstan/phpstan/issues/647
                $language = substr($language, 0, $pos);
            }
            if (is_readable($dir . DIRECTORY_SEPARATOR . $language . '.yml') === true) {
                $newOnes = Config::get($dir . DIRECTORY_SEPARATOR . $language . '.yml');
                if (is_array($newOnes) === true) {
                    if ($prefix != null) {
                        $newOnes = array($prefix => $newOnes);
                    }
                    self::$translations = array_merge(self::$translations, $newOnes);
                }
            } else {
                Logger::get()->notice('can\'t find language "' . $language . '" in directory "' . $dir . '"');
            }
        }
    }
public static function registerTranslations($baseDir, $localesDir, $prefix = null)
    {
        if (self::$isInit === true) {
            $dir = $baseDir . DIRECTORY_SEPARATOR . $localesDir;
            if (is_dir($dir) === false) {
                throw new InvalidDirectory('directory "' . $dir . '" can\'t be identified');
            }
            $language = self::$currentLanguage;
            if (($pos = strpos($language, '-')) !== false) {
                $pos = (int) $pos; // re: https://github.com/phpstan/phpstan/issues/647
                $language = substr($language, 0, $pos);
            }
            if (($pos = strpos($language, '_')) !== false) {
                $pos = (int) $pos; // re: https://github.com/phpstan/phpstan/issues/647
                $language = substr($language, 0, $pos);
            }
            if (is_readable($dir . DIRECTORY_SEPARATOR . $language . '.yml') === true) {
                $newOnes = Config::get($dir . DIRECTORY_SEPARATOR . $language . '.yml');
                if (is_array($newOnes) === true) {
                    if ($prefix != null) {
                        $newOnes = array($prefix => $newOnes);
                    }
                    self::$translations = array_merge(self::$translations, $newOnes);
                }
            } else {
                Logger::get()->notice('can\'t find language "' . $language . '" in directory "' . $dir . '"');
            }
        }
    }
public static function registerTranslations ( $ baseDir , $ localesDir , $ prefix = null ) { if ( self :: $ isInit === true ) { $ dir = $ baseDir . DIRECTORY_SEPARATOR . $ localesDir ; if ( is_dir ( $ dir ) === false ) { throw new InvalidDirectory ( 'directory "' . $ dir . '" can\'t be identified' ) ; } $ language = self :: $ currentLanguage ; if ( ( $ pos = strpos ( $ language , '-' ) ) !== false ) { $ pos = ( int ) $ pos ; // re: https://github.com/phpstan/phpstan/issues/647 $ language = substr ( $ language , 0 , $ pos ) ; } if ( ( $ pos = strpos ( $ language , '_' ) ) !== false ) { $ pos = ( int ) $ pos ; // re: https://github.com/phpstan/phpstan/issues/647 $ language = substr ( $ language , 0 , $ pos ) ; } if ( is_readable ( $ dir . DIRECTORY_SEPARATOR . $ language . '.yml' ) === true ) { $ newOnes = Config :: get ( $ dir . DIRECTORY_SEPARATOR . $ language . '.yml' ) ; if ( is_array ( $ newOnes ) === true ) { if ( $ prefix != null ) { $ newOnes = array ( $ prefix => $ newOnes ) ; } self :: $ translations = array_merge ( self :: $ translations , $ newOnes ) ; } } else { Logger :: get ( ) -> notice ( 'can\'t find language "' . $ language . '" in directory "' . $ dir . '"' ) ; } } }
Load translations from directory according to current language.

@static
@throws InvalidDirectory if directory can't be identified
@param  string           $baseDir    application directory path
@param  string           $localesDir translations directory path
@param  string           $prefix     prefix for all translations from this directory
Load translations from directory according to current language .