mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
29 lines
561 B
PHP
29 lines
561 B
PHP
<?php
|
|
|
|
class i18nActions extends Actions
|
|
{
|
|
public static function setCulture()
|
|
{
|
|
$culture = Request::getPostParam('culture');
|
|
|
|
// Validate
|
|
if ($culture && !in_array($culture, i18n::getAllCultures()))
|
|
{
|
|
$culture = null;
|
|
}
|
|
|
|
if ($culture)
|
|
{
|
|
Session::set(Session::KEY_USER_CULTURE, $culture);
|
|
}
|
|
else
|
|
{
|
|
Session::unsetKey(Session::KEY_USER_CULTURE);
|
|
}
|
|
|
|
//if session changes update domain
|
|
//english language = www
|
|
|
|
return Controller::redirect(Request::getHttpHeader('Referer', '/'));
|
|
}
|
|
}
|