mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 09:37:26 +00:00
25 lines
593 B
PHP
25 lines
593 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::getReferrer());
|
|
}
|
|
}
|