mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
i18n: Store user culture in session
This commit is contained in:
parent
d689d4d19f
commit
e0b3d0921a
3 changed files with 8 additions and 2 deletions
|
@ -6,7 +6,8 @@ class Session
|
||||||
KEY_DOWNLOAD_ALLOWED = 'beta_download_allowed2',
|
KEY_DOWNLOAD_ALLOWED = 'beta_download_allowed2',
|
||||||
KEY_PREFINERY_USER_ID = 'prefinery_user_id',
|
KEY_PREFINERY_USER_ID = 'prefinery_user_id',
|
||||||
KEY_PREFINER_USED_CUSTOM_CODE = 'prefinery_used_custom_code',
|
KEY_PREFINER_USED_CUSTOM_CODE = 'prefinery_used_custom_code',
|
||||||
KEY_LIST_SUB_ERROR = 'list_error';
|
KEY_LIST_SUB_ERROR = 'list_error',
|
||||||
|
KEY_USER_CULTURE = 'user_culture';
|
||||||
|
|
||||||
public static function init()
|
public static function init()
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,6 +17,11 @@ class i18n
|
||||||
|
|
||||||
public static function register($culture = null) /*needed to trigger class include, presumably setup would happen here*/
|
public static function register($culture = null) /*needed to trigger class include, presumably setup would happen here*/
|
||||||
{
|
{
|
||||||
|
if ($culture == null)
|
||||||
|
{
|
||||||
|
$culture = Session::get(Session::KEY_USER_CULTURE);
|
||||||
|
}
|
||||||
|
|
||||||
if ($culture === null)
|
if ($culture === null)
|
||||||
{
|
{
|
||||||
$urlTokens = Request::getHost() ? explode('.', Request::getHost()) : [];
|
$urlTokens = Request::getHost() ? explode('.', Request::getHost()) : [];
|
||||||
|
|
|
@ -25,8 +25,8 @@ if (!IS_PRODUCTION)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
i18n::register();
|
|
||||||
Session::init();
|
Session::init();
|
||||||
|
i18n::register();
|
||||||
if (!IS_PRODUCTION)
|
if (!IS_PRODUCTION)
|
||||||
{
|
{
|
||||||
View::compileCss();
|
View::compileCss();
|
||||||
|
|
Loading…
Add table
Reference in a new issue