src/Core/Localization.php
public function load($file, $module = 'application', $language = null, $overwrite = false)
    {
        if (!$overwrite && isset($this->files[$module][$language][$file])) {
            return $this;
        }

        $module = strtolower($module);
        switch ($module) {
            //TODO: ucfirst($module) for more than 1 word?
            case 'core':
                $file_path = dirname(__DIR__) . '/' . ucfirst($module) . '/localization/' . $language . '/' . $file . '.php';
                $default_file_path = dirname(__DIR__) . '/' . ucfirst($module) . '/localization/' . $this->default_language . '/' . $file . '.php';
                break;
            case 'application':
                $file_path = APPLICATION_PATH . 'localization/' . $language . '/' . $file . '.php';
                $default_file_path = APPLICATION_PATH . 'localization/' . $this->default_language . '/' . $file . '.php';
                break;
            default:
                $file_path = dirname(__DIR__) . '/Modules/' . ucfirst($module) . '/localization/' . $language . '/' . $file . '.php';
                $default_file_path = dirname(__DIR__) . '/Modules/' . ucfirst($module) . '/localization/' . $this->default_language . '/' . $file . '.php';
        }

        if (file_exists($file_path)) {
            if (!isset($this->lines[$language])) {
                $this->lines[$language] = [];
            }

            //TODO: correct include_once
            $lines = include $file_path;
            $this->lines[$language] = array_merge($this->lines[$language], $lines);

            return $language;
        } elseif (file_exists($default_file_path)) {
            if (!isset($this->lines[$this->default_language])) {
                $this->lines[$this->default_language] = [];
            }

            $lines = include $default_file_path;
            $this->lines[$this->default_language] = array_merge($this->lines[$this->default_language], $lines);

            return $this->default_language;
        } else {
            throw new \RuntimeException('Don`t find language file');
        }
    }
public function load($file, $module = 'application', $language = null, $overwrite = false)
    {
        if (!$overwrite && isset($this->files[$module][$language][$file])) {
            return $this;
        }

        $module = strtolower($module);
        switch ($module) {
            //TODO: ucfirst($module) for more than 1 word?
            case 'core':
                $file_path = dirname(__DIR__) . '/' . ucfirst($module) . '/localization/' . $language . '/' . $file . '.php';
                $default_file_path = dirname(__DIR__) . '/' . ucfirst($module) . '/localization/' . $this->default_language . '/' . $file . '.php';
                break;
            case 'application':
                $file_path = APPLICATION_PATH . 'localization/' . $language . '/' . $file . '.php';
                $default_file_path = APPLICATION_PATH . 'localization/' . $this->default_language . '/' . $file . '.php';
                break;
            default:
                $file_path = dirname(__DIR__) . '/Modules/' . ucfirst($module) . '/localization/' . $language . '/' . $file . '.php';
                $default_file_path = dirname(__DIR__) . '/Modules/' . ucfirst($module) . '/localization/' . $this->default_language . '/' . $file . '.php';
        }

        if (file_exists($file_path)) {
            if (!isset($this->lines[$language])) {
                $this->lines[$language] = [];
            }

            //TODO: correct include_once
            $lines = include $file_path;
            $this->lines[$language] = array_merge($this->lines[$language], $lines);

            return $language;
        } elseif (file_exists($default_file_path)) {
            if (!isset($this->lines[$this->default_language])) {
                $this->lines[$this->default_language] = [];
            }

            $lines = include $default_file_path;
            $this->lines[$this->default_language] = array_merge($this->lines[$this->default_language], $lines);

            return $this->default_language;
        } else {
            throw new \RuntimeException('Don`t find language file');
        }
    }
@param string $file
@param string $module
@param string $language
@param boolean $overwrite

@throws \RuntimeException

@return boolean