Skip to content

Commit e0b3d09

Browse files
loblaolyoshenka
authored andcommitted
i18n: Store user culture in session
1 parent d689d4d commit e0b3d09

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

controller/Session.class.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ class Session
66
KEY_DOWNLOAD_ALLOWED = 'beta_download_allowed2',
77
KEY_PREFINERY_USER_ID = 'prefinery_user_id',
88
KEY_PREFINER_USED_CUSTOM_CODE = 'prefinery_used_custom_code',
9-
KEY_LIST_SUB_ERROR = 'list_error';
9+
KEY_LIST_SUB_ERROR = 'list_error',
10+
KEY_USER_CULTURE = 'user_culture';
1011

1112
public static function init()
1213
{

lib/i18n.class.php

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class i18n
1717

1818
public static function register($culture = null) /*needed to trigger class include, presumably setup would happen here*/
1919
{
20+
if ($culture == null)
21+
{
22+
$culture = Session::get(Session::KEY_USER_CULTURE);
23+
}
24+
2025
if ($culture === null)
2126
{
2227
$urlTokens = Request::getHost() ? explode('.', Request::getHost()) : [];

web/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
try
2727
{
28-
i18n::register();
2928
Session::init();
29+
i18n::register();
3030
if (!IS_PRODUCTION)
3131
{
3232
View::compileCss();

0 commit comments

Comments
 (0)