diff --git a/controller/Controller.class.php b/controller/Controller.class.php index f0bafa9b..7872cf22 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -94,6 +94,8 @@ class Controller $router->any('/list/subscribe', 'MailActions::executeSubscribe'); $router->get('/list/confirm/{hash}', 'MailActions::executeConfirm'); + $router->post('/language', 'i18nActions::setCulture'); + $permanentRedirects = [ '/lbry-osx-latest.dmg' => '/get', '/lbry-linux-latest.deb' => '/get', diff --git a/controller/action/i18nActions.class.php b/controller/action/i18nActions.class.php new file mode 100644 index 00000000..f7fc492a --- /dev/null +++ b/controller/action/i18nActions.class.php @@ -0,0 +1,33 @@ +
GitHub -
\ No newline at end of file + +
+ +
+ + diff --git a/web/js/global.js b/web/js/global.js index 32ffcdf0..2d91ef42 100644 --- a/web/js/global.js +++ b/web/js/global.js @@ -162,4 +162,13 @@ $(document).ready(function() { }); }); } -}); \ No newline at end of file + + var langDropdown = $('#language-dropdown'); + langDropdown.val(_currentLang); + langDropdown.on('change', function(x) { + $.ajax({type: 'POST', url: '/language', data: {'culture': this.value}, + success: function (d) { + window.location.reload(); + }}); + }); +});