protected function parseLangFiles($file, $key, $dir)
    {
        // Base package name without file ending
        $packageName = basename($file, '.php');

        // Get package, language and file contents from language file
        // /<language_code>/(<package/)<filename>.php
        $language = explode(DIRECTORY_SEPARATOR, $file)[1];
        $fileContents = require $dir.DIRECTORY_SEPARATOR.$file;

        // Check if language already exists in array
        if (array_key_exists($language, $this->strings)) {
            if (array_key_exists($packageName, $this->strings[$language])) {
                $this->strings[$language][$packageName] =
                    array_replace_recursive((array) $this->strings[$language][$packageName], (array)
                    $fileContents);
            } else {
                $this->strings[$language][$packageName] = $fileContents;
            }
        } else {
            $this->strings[$language] = [
                $packageName => $fileContents,
            ];
        }
    }