Skip to content

Commit

Permalink
fix the lang with config
Browse files Browse the repository at this point in the history
  • Loading branch information
dcto committed Jan 28, 2023
1 parent db4488f commit f70bc4e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/I18n/Lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ public function getLocale()
public function detect()
{
$language = make('request')->language();
foreach (config('i18n') as $locale) {
if (strstr($language, $locale)) {
return $locale;
if($i18ns = config('i18n')){
foreach ($i18ns as $locale) {
if (strstr($language, $locale)) {
return $locale;
}
}
}
return $language;
Expand Down

0 comments on commit f70bc4e

Please sign in to comment.