Language Switching

customer can now choose preferred language from available language list.

we are store language in session for now, if customer logout the language will reset back to default, we will move it to database in the coming update.
This commit is contained in:
Focuslinkstech
2024-08-14 18:24:43 +01:00
parent 676dcbe478
commit 5cb1a901c3
5 changed files with 102 additions and 11 deletions

View File

@ -10,7 +10,12 @@ class Lang
{
public static function T($key)
{
global $_L, $lan_file, $config;
global $_L, $lan_file, $root_path, $config;
if (empty($lan_file)) {
$lan_file = $root_path . File::pathFixer('system/lan/' . $config['language'] . '.json');
}
if (is_array($_SESSION['Lang'])) {
$_L = array_merge($_L, $_SESSION['Lang']);
}