diff --git a/src/boot/i18n.js b/src/boot/i18n.js
index 079fbc3b..cfd98a46 100644
--- a/src/boot/i18n.js
+++ b/src/boot/i18n.js
@@ -2,7 +2,6 @@
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import {
- getLanguageLabels,
messages
} from 'src/i18n'
import {
@@ -23,15 +22,12 @@ export const i18n = new VueI18n({
})
export default ({ app, store }) => {
- store.commit('user/setLanguageLabels', getLanguageLabels())
-
app.i18n = i18n
store.$i18n = i18n
if (!hasSession('locale')) {
setSession('locale', navigator.language)
}
i18n.locale = getSession('locale') + ''
- store.commit('user/changeSessionLocaleSucceeded', i18n.locale)
store.watch(() => i18n.locale, () => {
store.dispatch('reloadLanguageRelatedData')
diff --git a/src/components/CscLanguageMenu.vue b/src/components/CscLanguageMenu.vue
deleted file mode 100644
index 24ae757f..00000000
--- a/src/components/CscLanguageMenu.vue
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
- {{ language[1] }}
-
-
-
-
-
-
-
-
diff --git a/src/components/CscSelectionLanguage.vue b/src/components/CscSelectionLanguage.vue
new file mode 100644
index 00000000..b86aa934
--- /dev/null
+++ b/src/components/CscSelectionLanguage.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+ {{ languageLabel }}
+
+
+
+
+ {{ language.label }}
+
+
+
+
+
+
diff --git a/src/components/CscSelectionLanguageMobile.vue b/src/components/CscSelectionLanguageMobile.vue
new file mode 100644
index 00000000..e554a353
--- /dev/null
+++ b/src/components/CscSelectionLanguageMobile.vue
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+ {{ language.label }}
+
+
+
+
+
+
+
+
diff --git a/src/i18n/de.json b/src/i18n/de.json
index e31ed0c5..49816bec 100644
--- a/src/i18n/de.json
+++ b/src/i18n/de.json
@@ -227,7 +227,7 @@
"End date": "",
"End time": "",
"Ended": "Anruf beendet",
- "English": "Deutsch",
+ "German": "Deutsch",
"Established": "Verbunden",
"Every caller": "Alle Anrufer",
"Exit": "Beenden",
@@ -721,4 +721,4 @@
"{field} must have at most {maxLength} letters": "{field} darf höchstens {maxLength} Buchstaben beinhalten",
"{mode} of sources": "{mode} of sources",
"{mode} own phone": "Eigene Rufnummer {mode}"
-}
\ No newline at end of file
+}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 87218f7a..aeb58fda 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -143,6 +143,7 @@
"Enable regex matching for "Received from IP" and "Destination" fields.": "Enable regex matching for "Received from IP" and "Destination" fields.",
"Enable strict mode that requires all mail2fax emails to have the secret key as the very first line of the email + an empty line. The key is removed from the email once matched.": "Enable strict mode that requires all mail2fax emails to have the secret key as the very first line of the email + an empty line. The key is removed from the email once matched.",
"End time": "End time",
+ "English": "English",
"Enter a number to dial": "Enter a number to dial",
"Expires": "Expires",
"Extension": "Extension",
@@ -169,10 +170,12 @@
"Forwarding": "Forwarding",
"Fr": "Fr",
"Free": "Free",
+ "French": "French",
"Friday": "Friday",
"From": "From",
"From email": "From email",
"General": "General",
+ "German": "German",
"Group": "Group",
"Group Name": "Group Name",
"Group/Seat/Pilot": "Group/Seat/Pilot",
@@ -198,6 +201,7 @@
"Input a valid mac address": "Input a valid mac address",
"Input a valid phone number": "Input a valid phone number",
"Interval when the secret key is automatically renewed.": "Interval when the secret key is automatically renewed.",
+ "Italian": "Italian",
"Join conference": "Join conference",
"Join conference with name": "Join conference with name",
"Lamp/Key": "Lamp/Key",
@@ -332,6 +336,7 @@
"Ring primary number": "Ring primary number",
"Ringing at": "Ringing at",
"Ringing at {number}...": "Ringing at {number}...",
+ "Russian": "Russian",
"Sa": "Sa",
"Same time for selected days": "Same time for selected days",
"Saturday": "Saturday",
@@ -370,6 +375,7 @@
"Something went wrong. Please retry later": "Something went wrong. Please retry later",
"Sound Set": "Sound Set",
"Sound Sets": "Sound Sets",
+ "Spanish": "Spanish",
"Speed Dial": "Speed Dial",
"Start and End time should be set": "Start and End time should be set",
"Start new call": "Start new call",
diff --git a/src/i18n/es.json b/src/i18n/es.json
index cd44532a..a3c3956e 100644
--- a/src/i18n/es.json
+++ b/src/i18n/es.json
@@ -227,7 +227,7 @@
"End date": "",
"End time": "",
"Ended": "Terminada",
- "English": "Español",
+ "Spanish": "Español",
"Established": "Establecida",
"Every caller": "",
"Exit": "Salir",
@@ -721,4 +721,4 @@
"{field} must have at most {maxLength} letters": "{field} debe tener como máximo {maxLength} letras",
"{mode} of sources": "{mode} de fuentes",
"{mode} own phone": "{mode} teléfono propio"
-}
\ No newline at end of file
+}
diff --git a/src/i18n/fr.json b/src/i18n/fr.json
index 420cd4d6..1ecdcfc5 100644
--- a/src/i18n/fr.json
+++ b/src/i18n/fr.json
@@ -227,7 +227,7 @@
"End date": "Date de fin",
"End time": "Date de fin",
"Ended": "Terminé",
- "English": "Français",
+ "French": "Français",
"Established": "Établi",
"Every caller": "Chaque appelant",
"Exit": "Sortie",
diff --git a/src/i18n/index.js b/src/i18n/index.js
index 8792953a..767d09fd 100644
--- a/src/i18n/index.js
+++ b/src/i18n/index.js
@@ -1,4 +1,3 @@
-import _ from 'lodash'
import localeEn from './en.json'
import localeFr from './fr.json'
import localeIt from './it.json'
@@ -13,27 +12,40 @@ export const defaultLocale = 'en-US'
export const messages = {
'en-US': patchKeysForFallback(localeEn),
+ de: patchKeysForFallback(localeDe),
+ es: patchKeysForFallback(localeEs),
fr: patchKeysForFallback(localeFr),
it: patchKeysForFallback(localeIt),
- es: patchKeysForFallback(localeEs),
- de: patchKeysForFallback(localeDe),
ru: patchKeysForFallback(localeRu)
}
export function getLanguageLabels () {
- const languageLabels = []
- Object.keys(messages).forEach((locale) => {
- languageLabels.push([locale, messages[locale].English])
- })
- return languageLabels
-}
-
-export function getLanguageLabel (locale) {
- if (_.has(messages, locale)) {
- return messages[locale].English
- } else {
- return messages[defaultLocale].English
- }
+ return [
+ {
+ value: 'en-US',
+ label: i18n.t('English', 'en-US')
+ },
+ {
+ value: 'de',
+ label: i18n.t('German', 'de')
+ },
+ {
+ value: 'es',
+ label: i18n.t('Spanish', 'es')
+ },
+ {
+ value: 'fr',
+ label: i18n.t('French', 'fr')
+ },
+ {
+ value: 'it',
+ label: i18n.t('Italian', 'it')
+ },
+ {
+ value: 'ru',
+ label: i18n.t('Russian', 'ru')
+ }
+ ]
}
function patchKeysForFallback (messages = {}) {
diff --git a/src/i18n/it.json b/src/i18n/it.json
index d328bab0..61ad4357 100644
--- a/src/i18n/it.json
+++ b/src/i18n/it.json
@@ -227,7 +227,7 @@
"End date": "",
"End time": "",
"Ended": "Terminata",
- "English": "Italiano",
+ "Italian": "Italiano",
"Established": "Stabilita",
"Every caller": "",
"Exit": "Esci",
@@ -721,4 +721,4 @@
"{field} must have at most {maxLength} letters": "Il campo {field} può contenere al massimo {maxLength} lettere",
"{mode} of sources": "{mode} dei pattern sorgente",
"{mode} own phone": "{mode} proprio telefono"
-}
\ No newline at end of file
+}
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index b1c8eafb..94129c28 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -228,7 +228,7 @@
"End date": "Конечная дата",
"End time": "Время окончания",
"Ended": "Завершено",
- "English": "Русский",
+ "Russian": "Русский",
"Enter a number to dial": "Введите номер для набора",
"Established": "Установлено",
"Every caller": "Каждый звонящий",
@@ -723,4 +723,4 @@
"{field} must have at most {maxLength} letters": "{field} должен иметь не более {maxLength} букв",
"{mode} of sources": "{mode} источников",
"{mode} own phone": "У {mode} есть телефон"
-}
\ No newline at end of file
+}
diff --git a/src/layouts/CscLayoutMain.vue b/src/layouts/CscLayoutMain.vue
index 2eab6f88..1765a06b 100644
--- a/src/layouts/CscLayoutMain.vue
+++ b/src/layouts/CscLayoutMain.vue
@@ -37,25 +37,9 @@
/>
-
-
-
-
-
+ />
-
-
-
-
-
-
+
@@ -121,21 +105,18 @@ import {
import {
Platform
} from 'quasar'
-import {
- getLanguageLabel
-} from '../i18n'
-import CscLanguageMenu from 'components/CscLanguageMenu'
import CscSpinner from 'components/CscSpinner'
import CscInputPassword from 'components/form/CscInputPassword'
import CscInput from 'components/form/CscInput'
import CscRetrievePasswordDialog from 'components/CscRetrievePasswordDialog'
+import CscSelectionLanguage from 'components/CscSelectionLanguage'
export default {
name: 'Login',
components: {
+ CscSelectionLanguage,
CscInput,
CscInputPassword,
CscSpinner,
- CscLanguageMenu,
CscRetrievePasswordDialog
},
data () {
@@ -159,15 +140,8 @@ export default {
...mapGetters('user', [
'loginRequesting',
'loginSucceeded',
- 'loginError',
- 'locale',
- 'languageLabels'
- ]),
- languageLabel () {
- return this.$t('Language ({language})', {
- language: getLanguageLabel(this.locale)
- })
- }
+ 'loginError'
+ ])
},
watch: {
loginSucceeded (loggedIn) {
@@ -188,9 +162,6 @@ export default {
password: this.password
})
},
- changeLanguage (language) {
- this.$store.dispatch('user/changeSessionLanguage', language)
- },
showRetrievePasswordDialog () {
this.showDialog = true
}
diff --git a/src/store/user.js b/src/store/user.js
index 17547f27..14ba37f5 100644
--- a/src/store/user.js
+++ b/src/store/user.js
@@ -24,7 +24,6 @@ import QRCode from 'qrcode'
import {
qrPayload
} from 'src/helpers/qr'
-import { setLanguage } from 'src/i18n'
export default {
namespaced: true,
@@ -46,10 +45,6 @@ export default {
userDataError: null,
rtcEngineInitState: RequestState.initiated,
rtcEngineInitError: null,
- sessionLocale: null,
- changeSessionLocaleState: RequestState.initiated,
- changeSessionLocaleError: null,
- languageLabels: [],
changePasswordState: RequestState.initiated,
changePasswordError: null,
newPasswordRequesting: false,
@@ -157,15 +152,6 @@ export default {
isRtcEngineInitializing (state) {
return state.rtcEngineInitState === RequestState.requesting
},
- changeSessionLocaleState (state) {
- return state.changeSessionLocaleState
- },
- locale (state) {
- return state.sessionLocale
- },
- languageLabels (state) {
- return state.languageLabels
- },
getSubscriber (state) {
return state.subscriber
},
@@ -265,22 +251,6 @@ export default {
state.rtcEngineInitState = RequestState.failed
state.rtcEngineInitError = error
},
- changeSessionLocaleRequesting (state) {
- state.changeSessionLocaleState = RequestState.requesting
- state.changeSessionLocaleError = null
- },
- changeSessionLocaleSucceeded (state, locale) {
- state.sessionLocale = locale
- state.changeSessionLocaleState = RequestState.succeeded
- state.changeSessionLocaleError = null
- },
- changeSessionLocaleFailed (state, error) {
- state.changeSessionLocaleState = RequestState.failed
- state.changeSessionLocaleError = error
- },
- setLanguageLabels (state, languageLabels) {
- state.languageLabels = languageLabels
- },
userPasswordRequesting (state) {
state.changePasswordState = RequestState.requesting
state.changePasswordError = null
@@ -376,16 +346,6 @@ export default {
await context.dispatch('forwardHome')
}
},
- changeSessionLanguage (context, locale) {
- context.commit('changeSessionLocaleRequesting')
- try {
- setLanguage(locale)
-
- context.commit('changeSessionLocaleSucceeded', locale)
- } catch (error) {
- context.commit('changeSessionLocaleFailed', error)
- }
- },
changePassword (context, newPassword) {
const subscriberId = getSubscriberId()
context.commit('userPasswordRequesting')