public static function getCurrentLangCode() { if (I18n::$_langCode != null) { return I18n::$_langCode; } $currentLanguage = Openbiz::$app->getSessionContext()->getVar("LANG"); // default language if ($currentLanguage == "") { $currentLanguage = Openbiz::$app->getUserPreference("language"); } if ($currentLanguage == "") { $currentLanguage = I18n::DEFAULT_LANGUAGE; } // language from url if (isset($_GET['lang'])) { $currentLanguage = $_GET['lang']; Openbiz::$app->getSessionContext()->setVar("LANG", $currentLanguage); } // TODO: user pereference has language setting Openbiz::$app->getSessionContext()->setVar("LANG", $currentLanguage); I18n::$_langCode = $currentLanguage; return $currentLanguage; }