{"record":{"id":"bf8eb143069b6e89","repo":"flarum/framework","slug":"expected-to-find-path-directory-in-language-pack","errorCode":null,"errorMessage":"Expected to find \"<path>\" directory in language pack.","messagePattern":"Expected to find \"<path>\" directory in language pack\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Extend/LanguagePack.php","lineNumber":71,"sourceCode":"            );\n        }\n\n        $container->resolving(\n            LocaleManager::class,\n            function (LocaleManager $locales, Container $container) use ($extension, $locale, $title) {\n                $this->registerLocale($container, $locales, $extension, $locale, $title);\n            }\n        );\n    }\n\n    private function registerLocale(Container $container, LocaleManager $locales, Extension $extension, string $locale, string $title): void\n    {\n        $locales->addLocale($locale, $title);\n\n        $directory = $extension->getPath().$this->path;\n\n        if (! is_dir($directory)) {\n            throw new RuntimeException(\n                'Expected to find \"'.$this->path.'\" directory in language pack.'\n            );\n        }\n\n        if (file_exists($file = $directory.'/config.js')) {\n            $locales->addJsFile($locale, $file);\n        }\n\n        if (file_exists($file = $directory.'/config.css')) {\n            $locales->addCssFile($locale, $file);\n        }\n\n        foreach (new DirectoryIterator($directory) as $file) {\n            if ($this->shouldLoad($file, $container)) {\n                $locales->addTranslations($locale, $file->getPathname());\n            }\n        }\n    }","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Extend/LanguagePack.php#L53-L89","documentation":"Thrown in LanguagePack::registerLocale when an installed language-pack extension does not contain the expected locale directory (extension path + configured path, default /locale). The pack declares a locale code/title in composer.json but ships no directory holding translation files, so no translations can be loaded when LocaleManager is resolved during boot.","triggerScenarios":"Thrown at framework/core/src/Extend/LanguagePack.php:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the missing locale/ directory inside the language pack extension","Verify the pack's composer.json extra.flarum-locale settings match the directory layout","Re-download/reinstall the language pack — the installation may be incomplete","If you are the pack author, ship your translation files under locale/"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}