Skip to content

Commit

Permalink
fix get_user_locale()
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Nov 21, 2024
1 parent c537ebc commit 28fdeb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/globalfunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1328,8 +1328,8 @@ function get_user_locale(int $uid): string
{
$sql = "select language.site_lang_folder from useers inner join language on users.lang = language.id where users.id = $uid limit 1";
$result = \Nexus\Database\NexusDB::select($sql);
if (empty($result) || empty($result['site_lang_folder'])) {
if (empty($result) || empty($result[0]['site_lang_folder'])) {
return "en";
}
return \App\Http\Middleware\Locale::$languageMaps[$result['site_lang_folder']] ?? 'en';
return \App\Http\Middleware\Locale::$languageMaps[$result[0]['site_lang_folder']] ?? 'en';
}

0 comments on commit 28fdeb6

Please sign in to comment.