TT#163509 Issue - i18n - Missing localisation on Forwarding tab

Change-Id: I525486b9e2fbcb8aac5776552fd2725e26449024
pull/10/head
Sergii Leonenko 4 years ago
parent 641b6f6089
commit b2c1c7b8ed

@ -1,3 +1,5 @@
const esModules = ['quasar/lang', 'lodash-es', 'quasar'].join('|')
module.exports = { module.exports = {
globals: { globals: {
__DEV__: true __DEV__: true
@ -52,9 +54,7 @@ module.exports = {
// '.*\\.vue$': '<rootDir>/node_modules/@quasar/quasar-app-extension-testing-unit-jest/node_modules/vue-jest', // '.*\\.vue$': '<rootDir>/node_modules/@quasar/quasar-app-extension-testing-unit-jest/node_modules/vue-jest',
// '.*\\.js$': '<rootDir>/node_modules/@quasar/quasar-app-extension-testing-unit-jest/node_modules/babel-jest' // '.*\\.js$': '<rootDir>/node_modules/@quasar/quasar-app-extension-testing-unit-jest/node_modules/babel-jest'
}, },
transformIgnorePatterns: [ transformIgnorePatterns: [`<rootDir>/node_modules/(?!(${esModules}))`],
'<rootDir>/node_modules/(?!quasar/lang)'
],
snapshotSerializers: [ snapshotSerializers: [
'<rootDir>/node_modules/jest-serializer-vue' '<rootDir>/node_modules/jest-serializer-vue'
], ],

@ -4,12 +4,10 @@ import VueI18n from 'vue-i18n'
import { import {
messages, messages,
getLangFromBrowserDefaults, getLangFromBrowserDefaults,
normalizeLocaleCode setLanguage
} from 'src/i18n' } from 'src/i18n'
import { import {
hasSession, getSession
getSession,
setSession
} from 'src/storage' } from 'src/storage'
Vue.use(VueI18n) Vue.use(VueI18n)
@ -24,13 +22,10 @@ export const i18n = new VueI18n({
}) })
export default ({ app, store }) => { export default ({ app, store }) => {
const currentLocale = getSession('locale') || getLangFromBrowserDefaults() || defaultLocale
app.i18n = i18n app.i18n = i18n
store.$i18n = i18n store.$i18n = i18n
if (!hasSession('locale')) { setLanguage(currentLocale)
setSession('locale', getLangFromBrowserDefaults())
}
i18n.locale = normalizeLocaleCode(getSession('locale'))
store.watch(() => i18n.locale, () => { store.watch(() => i18n.locale, () => {
store.dispatch('reloadLanguageRelatedData') store.dispatch('reloadLanguageRelatedData')
}) })

@ -251,7 +251,7 @@ export default {
async removeDestinationEvent (payload) { async removeDestinationEvent (payload) {
this.$q.dialog({ this.$q.dialog({
title: this.$t('Delete destination'), title: this.$t('Delete destination'),
message: 'You are about to delete this destination', message: this.$t('You are about to delete this destination'),
color: 'negative', color: 'negative',
cancel: true, cancel: true,
persistent: true persistent: true

@ -423,7 +423,7 @@ export default {
async deleteMappingEvent (mapping) { async deleteMappingEvent (mapping) {
this.$q.dialog({ this.$q.dialog({
title: this.$t('Delete forwarding'), title: this.$t('Delete forwarding'),
message: 'You are about to delete this forwarding', message: this.$t('You are about to delete this forwarding'),
color: 'negative', color: 'negative',
cancel: true, cancel: true,
persistent: true persistent: true

@ -479,6 +479,8 @@
"You are about to change your login password. After the password was changed successfully, you get automatically logged out to authenticate with the new password. ": "You are about to change your login password. After the password was changed successfully, you get automatically logged out to authenticate with the new password. ", "You are about to change your login password. After the password was changed successfully, you get automatically logged out to authenticate with the new password. ": "You are about to change your login password. After the password was changed successfully, you get automatically logged out to authenticate with the new password. ",
"You are about to delete recording #{id}": "You are about to delete recording #{id}", "You are about to delete recording #{id}": "You are about to delete recording #{id}",
"You are about to delete slot {slot}": "You are about to delete slot {slot}", "You are about to delete slot {slot}": "You are about to delete slot {slot}",
"You are about to delete this destination": "You are about to delete this destination",
"You are about to delete this forwarding": "You are about to delete this forwarding",
"You are about to delete time range \"{from} - {to}\"": "You are about to delete time range \"{from} - {to}\"", "You are about to delete time range \"{from} - {to}\"": "You are about to delete time range \"{from} - {to}\"",
"You are about to remove ACL: From email <{from_email}>": "You are about to remove ACL: From email <{from_email}>", "You are about to remove ACL: From email <{from_email}>": "You are about to remove ACL: From email <{from_email}>",
"You are about to remove call queue for {subscriber}": "You are about to remove call queue for {subscriber}", "You are about to remove call queue for {subscriber}": "You are about to remove call queue for {subscriber}",
@ -543,4 +545,4 @@
"{field} must be maximum of {maxValue} seconds": "{field} must be maximum of {maxValue} seconds", "{field} must be maximum of {maxValue} seconds": "{field} must be maximum of {maxValue} seconds",
"{field} must consist of numeric characters only": "{field} must consist of numeric characters only", "{field} must consist of numeric characters only": "{field} must consist of numeric characters only",
"{field} must have at most {maxLength} letters": "{field} must have at most {maxLength} letters" "{field} must have at most {maxLength} letters": "{field} must have at most {maxLength} letters"
} }

@ -53,7 +53,8 @@ function patchKeysForFallback (messages = {}) {
return messages return messages
} }
export function setLanguage (lang) { export function setLanguage (locale) {
const lang = normalizeLocaleCode(locale)
setSession('locale', lang) setSession('locale', lang)
i18n.locale = lang i18n.locale = lang
@ -61,8 +62,8 @@ export function setLanguage (lang) {
import( import(
/* webpackInclude: /(en-us|de|es|fr|it)\.js$/ */ /* webpackInclude: /(en-us|de|es|fr|it)\.js$/ */
'quasar/lang/' + quasarLangCode 'quasar/lang/' + quasarLangCode
).then(lang => { ).then(qLang => {
Quasar.lang.set(lang.default) Quasar.lang.set(qLang.default)
}) })
// Note: please extend "reloadLanguageRelatedData" action in the store if you are using language related API endpoints // Note: please extend "reloadLanguageRelatedData" action in the store if you are using language related API endpoints

Loading…
Cancel
Save