save language selection to session storage
and adding @FinnStutzenstein remarks adding changelog entry
This commit is contained in:
parent
940f0bbd1b
commit
612924c087
1
AUTHORS
1
AUTHORS
@ -27,3 +27,4 @@ Authors of OpenSlides in chronological order of first contribution:
|
|||||||
Meinert Leinigen <openslides@leinigen.cc>
|
Meinert Leinigen <openslides@leinigen.cc>
|
||||||
Andreas Engler <engel.a@web.de> (Russian translation)
|
Andreas Engler <engel.a@web.de> (Russian translation)
|
||||||
Raimund Renkert <raimund@renkert.org>
|
Raimund Renkert <raimund@renkert.org>
|
||||||
|
Jochen Saalfeld <jochen.saalfeld@intevation.de>
|
||||||
|
@ -103,6 +103,7 @@ Core:
|
|||||||
- Added caching for the index views [#3419, #3424].
|
- Added caching for the index views [#3419, #3424].
|
||||||
- Added projector prioritization [#3425].
|
- Added projector prioritization [#3425].
|
||||||
- Use native twisted mode for daphne [#3487].
|
- Use native twisted mode for daphne [#3487].
|
||||||
|
- Save language selection to session storage [#3543]
|
||||||
|
|
||||||
Mediafiles:
|
Mediafiles:
|
||||||
- Fixed reloading of PDF on page change [#3274].
|
- Fixed reloading of PDF on page change [#3274].
|
||||||
|
@ -190,15 +190,16 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
|
|
||||||
// gets all in OpenSlides available languages
|
// gets all in OpenSlides available languages
|
||||||
.factory('Languages', [
|
.factory('Languages', [
|
||||||
|
'$sessionStorage',
|
||||||
|
'$ngBootbox',
|
||||||
'gettext',
|
'gettext',
|
||||||
'gettextCatalog',
|
'gettextCatalog',
|
||||||
'OpenSlidesPlugins',
|
'OpenSlidesPlugins',
|
||||||
'$ngBootbox',
|
function ($sessionStorage, $ngBootbox, gettext, gettextCatalog, OpenSlidesPlugins) {
|
||||||
function (gettext, gettextCatalog, OpenSlidesPlugins, $ngBootbox) {
|
|
||||||
return {
|
return {
|
||||||
// get all available languages
|
// get all available languages
|
||||||
getLanguages: function () {
|
getLanguages: function () {
|
||||||
var current = gettextCatalog.getCurrentLanguage();
|
var current = $sessionStorage.language;
|
||||||
// Define here new languages...
|
// Define here new languages...
|
||||||
var languages = [
|
var languages = [
|
||||||
{ code: 'en', name: 'English' },
|
{ code: 'en', name: 'English' },
|
||||||
@ -236,7 +237,7 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
language.selected = false;
|
language.selected = false;
|
||||||
if (language.code == lang) {
|
if (language.code == lang) {
|
||||||
language.selected = true;
|
language.selected = true;
|
||||||
gettextCatalog.setCurrentLanguage(lang);
|
$sessionStorage.language = lang;
|
||||||
// Plugins
|
// Plugins
|
||||||
if (lang != 'en') {
|
if (lang != 'en') {
|
||||||
gettextCatalog.loadRemote("static/i18n/" + lang + ".json").then(function (success) {
|
gettextCatalog.loadRemote("static/i18n/" + lang + ".json").then(function (success) {
|
||||||
@ -311,12 +312,16 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
|
|
||||||
// set browser language as default language for OpenSlides
|
// set browser language as default language for OpenSlides
|
||||||
.run([
|
.run([
|
||||||
|
'$sessionStorage',
|
||||||
'gettextCatalog',
|
'gettextCatalog',
|
||||||
'Languages',
|
'Languages',
|
||||||
function(gettextCatalog, Languages) {
|
function($sessionStorage, gettextCatalog, Languages) {
|
||||||
// set detected browser language as default language (fallback: 'en')
|
// set detected browser language as default language (fallback: 'en')
|
||||||
Languages.setCurrentLanguage(Languages.getBrowserLanguage());
|
if ($sessionStorage.language) {
|
||||||
|
Languages.setCurrentLanguage($sessionStorage.language);
|
||||||
|
} else {
|
||||||
|
Languages.setCurrentLanguage(Languages.getBrowserLanguage());
|
||||||
|
}
|
||||||
// Set this to true for debug. Helps to find untranslated strings by
|
// Set this to true for debug. Helps to find untranslated strings by
|
||||||
// adding "[MISSING]:".
|
// adding "[MISSING]:".
|
||||||
gettextCatalog.debug = false;
|
gettextCatalog.debug = false;
|
||||||
|
@ -39,7 +39,7 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions',
|
|||||||
obj.enable = function () {
|
obj.enable = function () {
|
||||||
obj.active = true;
|
obj.active = true;
|
||||||
obj.isEditable = true;
|
obj.isEditable = true;
|
||||||
ckeditorOptions.language = gettextCatalog.getCurrentLanguage();
|
ckeditorOptions.language = localStorage.getItem('language');
|
||||||
obj.editor = CKEDITOR.inline(selector, ckeditorOptions);
|
obj.editor = CKEDITOR.inline(selector, ckeditorOptions);
|
||||||
obj.editor.on('change', function () {
|
obj.editor.on('change', function () {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user