mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
i18n: Send a POST request instead of an AJAX request
This commit is contained in:
parent
05d465905f
commit
5539860a0a
4 changed files with 9 additions and 10 deletions
|
@ -94,7 +94,7 @@ class Controller
|
||||||
$router->any('/list/subscribe', 'MailActions::executeSubscribe');
|
$router->any('/list/subscribe', 'MailActions::executeSubscribe');
|
||||||
$router->get('/list/confirm/{hash}', 'MailActions::executeConfirm');
|
$router->get('/list/confirm/{hash}', 'MailActions::executeConfirm');
|
||||||
|
|
||||||
$router->post('/language', 'i18nActions::setCulture');
|
$router->post('/set-culture', 'i18nActions::setCulture');
|
||||||
|
|
||||||
$permanentRedirects = [
|
$permanentRedirects = [
|
||||||
'/lbry-osx-latest.dmg' => '/get',
|
'/lbry-osx-latest.dmg' => '/get',
|
||||||
|
|
|
@ -28,6 +28,6 @@ class i18nActions extends Actions
|
||||||
Session::unsetKey(Session::KEY_USER_CULTURE);
|
Session::unsetKey(Session::KEY_USER_CULTURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [null, null];
|
return Controller::redirect('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,12 @@
|
||||||
<a href="https://github.com/lbryio"><span class="btn-label">GitHub</span><span class="icon-github icon-fw"></span></a>
|
<a href="https://github.com/lbryio"><span class="btn-label">GitHub</span><span class="icon-github icon-fw"></span></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-item no-label-desktop">
|
<div class="control-item no-label-desktop">
|
||||||
<select id="language-dropdown">
|
<form id="language-form" action="/set-culture" method="POST">
|
||||||
|
<select id="language-dropdown" name="culture">
|
||||||
<option>en_US</option>
|
<option>en_US</option>
|
||||||
<option>pt_PT</option>
|
<option>pt_PT</option>
|
||||||
</select>
|
</select>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -166,9 +166,6 @@ $(document).ready(function() {
|
||||||
var langDropdown = $('#language-dropdown');
|
var langDropdown = $('#language-dropdown');
|
||||||
langDropdown.val(_currentLang);
|
langDropdown.val(_currentLang);
|
||||||
langDropdown.on('change', function(x) {
|
langDropdown.on('change', function(x) {
|
||||||
$.ajax({type: 'POST', url: '/language', data: {'culture': this.value},
|
$('#language-form').submit();
|
||||||
success: function (d) {
|
|
||||||
window.location.reload();
|
|
||||||
}});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue