diff --git a/app/Http/Middleware/Localize.php b/app/Http/Middleware/Localize.php index 5beffc4f51f3..0ef76f00100a 100644 --- a/app/Http/Middleware/Localize.php +++ b/app/Http/Middleware/Localize.php @@ -58,7 +58,7 @@ public function handle($request, Closure $next) $userLanguage = $this->config->get('app.locale'); foreach ($supportedLanguages as $language) { - $language = substr($language, 0, 2); + $language = str_replace('_', '-', $language); if (isset($this->langs[$language])) { $userLanguage = $language;