From b0ba5c9b58f7258aff54ad665fd1b27ef6118d19 Mon Sep 17 00:00:00 2001 From: Hugo Zigha <hugo.zigha@al-enterprise.com> Date: Fri, 24 Jan 2025 15:42:06 +0100 Subject: [PATCH] MT#61834 Upgrade vue-i18n to v11 - "i18n.global. tc" changed by i18n.global.t - $t(<string>, <language>) changed by $t(<string>, {},{ locale: <language>}) Change-Id: Ifc90213c76c5a82b80c7f7b0497db346752159ff --- package.json | 2 +- src/api/common.js | 4 +- src/api/fax.js | 4 +- src/api/speed-dial.js | 2 +- src/api/user.js | 2 +- src/boot/constants.js | 6 +- src/boot/ngcp-call.js | 2 +- src/components/CscDataTableEditInput.vue | 2 +- src/components/CscDataTableEditSelect.vue | 2 +- src/components/CscSelectionLanguage.vue | 10 +- src/components/CscSelectionLanguageMobile.vue | 10 +- src/filters/date.js | 28 ++-- src/filters/time-set.js | 56 +++---- src/helpers/ui.js | 12 +- src/router/routes.js | 146 +++++++++--------- src/store/call-forwarding/actions.js | 37 +++-- src/store/call/actions.js | 2 +- src/store/call/common.js | 14 +- src/store/communication.js | 2 +- src/store/conversations/getters.js | 2 +- src/store/pbx-callqueues.js | 8 +- src/store/pbx-devices.js | 26 ++-- src/store/pbx-groups.js | 36 ++--- src/store/pbx-ms-configs.js | 10 +- src/store/pbx-seats.js | 50 +++--- src/store/pbx-soundsets.js | 16 +- src/store/pbx.js | 10 +- src/store/speed-dial.js | 6 +- src/store/voicebox.js | 24 +-- src/validators/index.js | 22 +-- yarn.lock | 42 ++--- 31 files changed, 297 insertions(+), 298 deletions(-) diff --git a/package.json b/package.json index aeae2ab7..40fdd52c 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "terser": "^5.14.2", "tiny-emitter": "2.1.0", "vue": "3.5.13", - "vue-i18n": "9.14.2", + "vue-i18n": "11.0.1", "vue-resource": "^1.5.1", "vue-router": "4.5.0", "vue-scrollto": "^2.18.2", diff --git a/src/api/common.js b/src/api/common.js index 4eff4c7d..cda70e05 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -153,10 +153,10 @@ function handleResponseError (err) { const code = _.get(err, 'response.data.code', null) let message = _.get(err, 'response.data.message', null) if (code === 403 && message === 'Invalid license') { - message = i18n.global.tc('Contact your administrator to activate this functionality') + message = i18n.global.t('Contact your administrator to activate this functionality') } if (code === 403 && message === 'Password expired') { - message = i18n.global.tc('Password Expired') + message = i18n.global.t('Password Expired') return this.$router.push({ path: PATH_CHANGE_PASSWORD }) } diff --git a/src/api/fax.js b/src/api/fax.js index 127a7937..c3c8f3d8 100644 --- a/src/api/fax.js +++ b/src/api/fax.js @@ -22,7 +22,7 @@ export async function setFaxServerField (options) { // searching for duplicates const destinationsIds = options.value.map((d) => d.destination) if ((new Set(destinationsIds)).size !== destinationsIds.length) { - throw Error(i18n.global.tc('The Destination Email is already used')) + throw Error(i18n.global.t('The Destination Email is already used')) } } return patchReplaceFull({ @@ -49,7 +49,7 @@ export async function setMailToFaxSettingField (options) { // searching for duplicates const destinationsIds = options.value.map((d) => d.destination) if ((new Set(destinationsIds)).size !== destinationsIds.length) { - throw Error(i18n.global.tc('The Notify Email is already used')) + throw Error(i18n.global.t('The Notify Email is already used')) } } return patchReplaceFull({ diff --git a/src/api/speed-dial.js b/src/api/speed-dial.js index e3815c67..d3b91cd5 100644 --- a/src/api/speed-dial.js +++ b/src/api/speed-dial.js @@ -28,7 +28,7 @@ export function getUnassignedSlots (id) { const slotOptions = [] unassignedSlots.forEach((slot) => { slotOptions.push({ - label: `${i18n.global.tc('Slot')} ${slot}`, + label: `${i18n.global.t('Slot')} ${slot}`, value: slot }) }) diff --git a/src/api/user.js b/src/api/user.js index b021a942..a5831bbd 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -189,7 +189,7 @@ export function changeExpiredPassword (payload) { resolve(result) }).catch((err) => { if (err.response.status === 401) { - reject(new Error(`Unauthorized. ${i18n.global.tc('Wrong username or password')}`)) + reject(new Error(`Unauthorized. ${i18n.global.t('Wrong username or password')}`)) } else if (err.response.status === 422) { reject(_formatPasswordError(err.response.data.message)) } else { diff --git a/src/boot/constants.js b/src/boot/constants.js index 73757d82..51286de4 100644 --- a/src/boot/constants.js +++ b/src/boot/constants.js @@ -2,19 +2,19 @@ export default ({ app }) => { app.config.globalProperties.$faxQualityOptions = [ { get label () { - return app.i18n.global.tc('Normal') + return app.i18n.global.t('Normal') }, value: 'normal' }, { get label () { - return app.i18n.global.tc('Fine') + return app.i18n.global.t('Fine') }, value: 'fine' }, { get label () { - return app.i18n.global.tc('Super') + return app.i18n.global.t('Super') }, value: 'super' } diff --git a/src/boot/ngcp-call.js b/src/boot/ngcp-call.js index 5665c44d..e621acbc 100644 --- a/src/boot/ngcp-call.js +++ b/src/boot/ngcp-call.js @@ -31,7 +31,7 @@ export default async ({ app, store }) => { callEvent.on('disconnected', ({ error, code }) => { let errorMessage = null if (error) { - errorMessage = i18n.global.tc('WebSocket connection to kamailio lb failed with code {code}', { + errorMessage = i18n.global.t('WebSocket connection to kamailio lb failed with code {code}', { code }) } diff --git a/src/components/CscDataTableEditInput.vue b/src/components/CscDataTableEditInput.vue index 5a93529d..f14d9d5b 100644 --- a/src/components/CscDataTableEditInput.vue +++ b/src/components/CscDataTableEditInput.vue @@ -37,7 +37,7 @@ export default { }, saveLabel: { type: String, - default: i18n.global.tc('Save') + default: i18n.global.t('Save') } }, emits: ['changed'], diff --git a/src/components/CscDataTableEditSelect.vue b/src/components/CscDataTableEditSelect.vue index b7faa7fd..6ad29a90 100644 --- a/src/components/CscDataTableEditSelect.vue +++ b/src/components/CscDataTableEditSelect.vue @@ -72,7 +72,7 @@ export default { }, saveLabel: { type: String, - default: i18n.global.tc('Save') + default: i18n.global.t('Save') } }, emits: ['saved'], diff --git a/src/components/CscSelectionLanguage.vue b/src/components/CscSelectionLanguage.vue index fb699b85..f781e32f 100644 --- a/src/components/CscSelectionLanguage.vue +++ b/src/components/CscSelectionLanguage.vue @@ -51,23 +51,23 @@ export default { return [ { value: 'en-US', - label: this.$t('English', 'en-US') + label: this.$t('English', {}, { locale: 'en-US' }) }, { value: 'de', - label: this.$t('German', 'de') + label: this.$t('German', {}, { locale: 'de' }) }, { value: 'es', - label: this.$t('Spanish', 'es') + label: this.$t('Spanish', {}, { locale: 'es' }) }, { value: 'fr', - label: this.$t('French', 'fr') + label: this.$t('French', {}, { locale: 'fr' }) }, { value: 'it', - label: this.$t('Italian', 'it') + label: this.$t('Italian', {}, { locale: 'it' }) } ] } diff --git a/src/components/CscSelectionLanguageMobile.vue b/src/components/CscSelectionLanguageMobile.vue index 8af6c818..674215c5 100644 --- a/src/components/CscSelectionLanguageMobile.vue +++ b/src/components/CscSelectionLanguageMobile.vue @@ -48,23 +48,23 @@ export default { return [ { value: 'en-US', - label: i18n.global.tc('English', 'en-US') + label: i18n.global.t('English', 1, { locale: 'en-US' }) }, { value: 'de', - label: i18n.global.tc('German', 'de') + label: i18n.global.t('German', 1, { locale: 'de' }) }, { value: 'es', - label: i18n.global.tc('Spanish', 'es') + label: i18n.global.t('Spanish', 1, { locale: 'es' }) }, { value: 'fr', - label: i18n.global.tc('French', 'fr') + label: i18n.global.t('French', 1, { locale: 'fr' }) }, { value: 'it', - label: i18n.global.tc('Italian', 'it') + label: i18n.global.t('Italian', 1, { locale: 'it' }) } ] } diff --git a/src/filters/date.js b/src/filters/date.js index 9e709447..6bcdff84 100644 --- a/src/filters/date.js +++ b/src/filters/date.js @@ -20,27 +20,27 @@ export function smartTime ($date) { const diffMinutes = Math.floor(diffSeconds / 60) const momentDate = moment(date) - let seconds = i18n.global.tc('second') + let seconds = i18n.global.t('second') if (diffSeconds > 1) { - seconds = i18n.global.tc('seconds') + seconds = i18n.global.t('seconds') } let minutes = 'minute' if (diffSeconds > 120) { - minutes = i18n.global.tc('minutes') + minutes = i18n.global.t('minutes') } if (diffSeconds < 60) { - const descriptor = i18n.global.tc('ago') + const descriptor = i18n.global.t('ago') return `${diffSeconds} ${seconds} ${descriptor}` } else if (diffSeconds < 3600) { - const descriptor = i18n.global.tc('ago') + const descriptor = i18n.global.t('ago') return `${diffMinutes} ${minutes} ${descriptor}` } else if (isToday(date)) { - const descriptor = i18n.global.tc('Today') + const descriptor = i18n.global.t('Today') return `${descriptor}, ${momentDate.format('HH:mm')}` } else if (isYesterday(date)) { - const descriptor = i18n.global.tc('Yesterday') + const descriptor = i18n.global.t('Yesterday') return `${descriptor}, ${momentDate.format('HH:mm')}` } else if (isWithinLastWeek(date)) { return momentDate.format('dddd, HH:mm') @@ -59,13 +59,13 @@ export const WeekdayMap = { } export const WeekdayTranslationMap = { - sunday: i18n.global.tc('Sunday'), - monday: i18n.global.tc('Monday'), - tuesday: i18n.global.tc('Tuesday'), - wednesday: i18n.global.tc('Wednesday'), - thursday: i18n.global.tc('Thursday'), - friday: i18n.global.tc('Friday'), - saturday: i18n.global.tc('Saturday') + sunday: i18n.global.t('Sunday'), + monday: i18n.global.t('Monday'), + tuesday: i18n.global.t('Tuesday'), + wednesday: i18n.global.t('Wednesday'), + thursday: i18n.global.t('Thursday'), + friday: i18n.global.t('Friday'), + saturday: i18n.global.t('Saturday') } export function weekday (weekdayNumber) { diff --git a/src/filters/time-set.js b/src/filters/time-set.js index 646c5cea..98dac6a8 100644 --- a/src/filters/time-set.js +++ b/src/filters/time-set.js @@ -12,41 +12,41 @@ export const DEFAULT_WEEKDAYS = [ export function getDayNameByNumber (dayNumber, isShortName = false) { const daysNamesMap = [ - i18n.global.tc('Monday'), - i18n.global.tc('Tuesday'), - i18n.global.tc('Wednesday'), - i18n.global.tc('Thursday'), - i18n.global.tc('Friday'), - i18n.global.tc('Saturday'), - i18n.global.tc('Sunday') + i18n.global.t('Monday'), + i18n.global.t('Tuesday'), + i18n.global.t('Wednesday'), + i18n.global.t('Thursday'), + i18n.global.t('Friday'), + i18n.global.t('Saturday'), + i18n.global.t('Sunday') ] // NOTE: in some languages the short days names may be not just first two letters of the full day's name const daysShortNamesMap = [ - i18n.global.tc('Mo'), - i18n.global.tc('Tu'), - i18n.global.tc('We'), - i18n.global.tc('Th'), - i18n.global.tc('Fr'), - i18n.global.tc('Sa'), - i18n.global.tc('Su') + i18n.global.t('Mo'), + i18n.global.t('Tu'), + i18n.global.t('We'), + i18n.global.t('Th'), + i18n.global.t('Fr'), + i18n.global.t('Sa'), + i18n.global.t('Su') ] return isShortName ? daysShortNamesMap[dayNumber] : daysNamesMap[dayNumber] } export function getMonthNameByNumber (monthNumber) { const monthsNamesMap = [ - i18n.global.tc('January'), - i18n.global.tc('February'), - i18n.global.tc('March'), - i18n.global.tc('April'), - i18n.global.tc('May'), - i18n.global.tc('June'), - i18n.global.tc('July'), - i18n.global.tc('August'), - i18n.global.tc('September'), - i18n.global.tc('October'), - i18n.global.tc('November'), - i18n.global.tc('December') + i18n.global.t('January'), + i18n.global.t('February'), + i18n.global.t('March'), + i18n.global.t('April'), + i18n.global.t('May'), + i18n.global.t('June'), + i18n.global.t('July'), + i18n.global.t('August'), + i18n.global.t('September'), + i18n.global.t('October'), + i18n.global.t('November'), + i18n.global.t('December') ] return monthsNamesMap[monthNumber] @@ -60,10 +60,10 @@ export function timeSetDateRange (times) { try { const hDateset = kamailioDatesetToHuman(times) return (hDateset.length === 0) - ? i18n.global.tc('empty') + ? i18n.global.t('empty') : hDateset.map((d) => (d.from === d.to) ? d.from : `${d.from}-${d.to}`).join(', ') } catch (e) { - return i18n.global.tc('data error') + return i18n.global.t('data error') } } diff --git a/src/helpers/ui.js b/src/helpers/ui.js index 1cdbfc79..cec116da 100644 --- a/src/helpers/ui.js +++ b/src/helpers/ui.js @@ -25,7 +25,7 @@ export function showGlobalError (messageOrException, timeout = 3000) { errorMessage = messageOrException?.response?.data?.message || messageOrException?.message } if (errorMessage === '' || errorMessage === undefined || errorMessage === null) { - errorMessage = i18n.global.tc('Unknown error') + errorMessage = i18n.global.t('Unknown error') } return Notify.create({ message: errorMessage, @@ -73,14 +73,14 @@ export function askForNotificationPermission () { if (_.isObject(Notification)) { Notification.requestPermission().then((perms) => { if (perms === 'denied' || perms === 'default') { - showPermanentGlobalWarning(i18n.global.tc('You have blocked incoming call notifications.')) + showPermanentGlobalWarning(i18n.global.t('You have blocked incoming call notifications.')) } resolve() }).catch((err) => { reject(err) }) } else { - showPermanentGlobalWarning(i18n.global.tc('Incoming call notifications are not supported.')) + showPermanentGlobalWarning(i18n.global.t('Incoming call notifications are not supported.')) resolve() } }) @@ -93,7 +93,7 @@ export function enableIncomingCallNotifications () { if (navigator.serviceWorker) { return navigator.serviceWorker.register(serviceWorkerPath) } - showPermanentGlobalWarning(i18n.global.tc('Incoming call notifications are not supported.')) + showPermanentGlobalWarning(i18n.global.t('Incoming call notifications are not supported.')) resolve() }).then(() => { return askForNotificationPermission() @@ -102,7 +102,7 @@ export function enableIncomingCallNotifications () { }).catch((err) => { // eslint-disable-next-line no-console console.debug(err) - showPermanentGlobalWarning(i18n.global.tc('Could not enable incoming call notifications.')) + showPermanentGlobalWarning(i18n.global.t('Could not enable incoming call notifications.')) }) }) } @@ -111,7 +111,7 @@ export function showCallNotification (number) { if (navigator.serviceWorker) { navigator.serviceWorker.getRegistration(serviceWorkerPath).then((registration) => { if (registration && registration.showNotification) { - registration.showNotification(i18n.global.tc('Incoming call from {number}', { + registration.showNotification(i18n.global.t('Incoming call from {number}', { number }), { requireInteraction: true, diff --git a/src/router/routes.js b/src/router/routes.js index f03295b6..a121ae45 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -63,7 +63,7 @@ const routes = [ component: CscPageDashboard, meta: { get title () { - return i18n.global.tc('Dashboard') + return i18n.global.t('Dashboard') } } }, @@ -72,7 +72,7 @@ const routes = [ component: CscPageHome, meta: { get title () { - return i18n.global.tc('Start new call') + return i18n.global.t('Start new call') }, subscriberProfile: ['csc_calls'] } @@ -84,10 +84,10 @@ const routes = [ props: true, meta: { get title () { - return i18n.global.tc('Conversations') + return i18n.global.t('Conversations') }, get subtitle () { - return i18n.global.tc('Calls, Faxes, VoiceMails') + return i18n.global.t('Calls, Faxes, VoiceMails') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.conversations } @@ -98,7 +98,7 @@ const routes = [ component: CscPageSubscriberPhonebook, meta: { get title () { - return i18n.global.tc('Subscriber Phonebook') + return i18n.global.t('Subscriber Phonebook') }, license: LICENSES.phonebook } @@ -108,7 +108,7 @@ const routes = [ component: CscPageSubscriberPhonebookAdd, meta: { get title () { - return i18n.global.tc('Add Phonebook') + return i18n.global.t('Add Phonebook') } } }, @@ -117,7 +117,7 @@ const routes = [ component: CscPageSubscriberPhonebookDetails, meta: { get title () { - return i18n.global.tc('Subscriber Phonebook') + return i18n.global.t('Subscriber Phonebook') } } }, @@ -126,7 +126,7 @@ const routes = [ component: CscPageCf, meta: { get title () { - return i18n.global.tc('Call Forwarding') + return i18n.global.t('Call Forwarding') } } }, @@ -135,10 +135,10 @@ const routes = [ component: CscPageCallBlockingIncoming, meta: { get title () { - return i18n.global.tc('Call Blocking') + return i18n.global.t('Call Blocking') }, get subtitle () { - return i18n.global.tc('Incoming') + return i18n.global.t('Incoming') }, profileAttributes: PROFILE_ATTRIBUTES_MAP.callBlockingIncoming } @@ -148,10 +148,10 @@ const routes = [ component: CscPageCallBlockingOutgoing, meta: { get title () { - return i18n.global.tc('Call Blocking') + return i18n.global.t('Call Blocking') }, get subtitle () { - return i18n.global.tc('Outgoing') + return i18n.global.t('Outgoing') }, profileAttributes: PROFILE_ATTRIBUTES_MAP.callBlockingOutgoing } @@ -161,10 +161,10 @@ const routes = [ component: CscPageCallBlockingPrivacy, meta: { get title () { - return i18n.global.tc('Call Blocking') + return i18n.global.t('Call Blocking') }, get subtitle () { - return i18n.global.tc('Privacy') + return i18n.global.t('Privacy') }, profileAttributes: PROFILE_ATTRIBUTES_MAP.callBlockingPrivacy } @@ -174,10 +174,10 @@ const routes = [ component: CscPageCallRecording, meta: { get title () { - return i18n.global.tc('Recordings') + return i18n.global.t('Recordings') }, get subtitle () { - return i18n.global.tc('Call recordings') + return i18n.global.t('Call recordings') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.recordings } @@ -187,10 +187,10 @@ const routes = [ component: CscPageReminder, meta: { get title () { - return i18n.global.tc('Reminder') + return i18n.global.t('Reminder') }, get subtitle () { - return i18n.global.tc('Set your personal alarm') + return i18n.global.t('Set your personal alarm') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.reminder } @@ -200,10 +200,10 @@ const routes = [ component: CscPageSpeedDial, meta: { get title () { - return i18n.global.tc('Speed Dial') + return i18n.global.t('Speed Dial') }, get subtitle () { - return i18n.global.tc('Set your speed dials') + return i18n.global.t('Set your speed dials') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.speedDial } @@ -213,10 +213,10 @@ const routes = [ component: CscPagePbxStatisticsCdr, meta: { get title () { - return i18n.global.tc('PBX Statistics') + return i18n.global.t('PBX Statistics') }, get subtitle () { - return i18n.global.tc('CDR') + return i18n.global.t('CDR') } }, license: LICENSES.pbx @@ -226,10 +226,10 @@ const routes = [ component: CscPagePbxGroups, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Groups') + return i18n.global.t('Groups') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.huntGroups } @@ -239,10 +239,10 @@ const routes = [ component: CscPagePbxGroupDetails, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Groups') + return i18n.global.t('Groups') } } }, @@ -251,10 +251,10 @@ const routes = [ component: CscPagePbxSeats, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Seats') + return i18n.global.t('Seats') } } }, @@ -263,10 +263,10 @@ const routes = [ component: CscPageCustomerPhonebook, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Customer Phonebook') + return i18n.global.t('Customer Phonebook') } } }, @@ -275,7 +275,7 @@ const routes = [ component: CscPageCustomerPhonebookAdd, meta: { get title () { - return i18n.global.tc('Add Phonebook') + return i18n.global.t('Add Phonebook') } } }, @@ -284,7 +284,7 @@ const routes = [ component: CscPageCustomerPhonebookUpload, meta: { get title () { - return i18n.global.tc('Upload CSV') + return i18n.global.t('Upload CSV') } } }, @@ -293,7 +293,7 @@ const routes = [ component: CscPageCustomerPhonebookDetails, meta: { get title () { - return i18n.global.tc('Customer Phonebook') + return i18n.global.t('Customer Phonebook') } } }, @@ -302,10 +302,10 @@ const routes = [ component: CscPagePbxDeviceDetails, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Devices') + return i18n.global.t('Devices') } } }, @@ -314,10 +314,10 @@ const routes = [ component: CscPagePbxSeatDetails, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Seats') + return i18n.global.t('Seats') } } }, @@ -326,10 +326,10 @@ const routes = [ component: CscPagePbxDevices, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Devices') + return i18n.global.t('Devices') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.deviceProvisioning } @@ -339,10 +339,10 @@ const routes = [ component: CscPagePbxCallQueues, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Call Queues') + return i18n.global.t('Call Queues') }, profileAttributes: PROFILE_ATTRIBUTES_MAP.extSettingsCallQueue } @@ -352,10 +352,10 @@ const routes = [ component: CscPagePbxSoundSets, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Sound Sets') + return i18n.global.t('Sound Sets') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.soundSet } @@ -365,10 +365,10 @@ const routes = [ component: CscPagePbxSoundSetDetails, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Sound Sets') + return i18n.global.t('Sound Sets') } } }, @@ -377,10 +377,10 @@ const routes = [ component: CscPagePbxMsConfigs, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Manager Secretary') + return i18n.global.t('Manager Secretary') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.manager_secretary } @@ -390,10 +390,10 @@ const routes = [ component: CscPagePbxAutoAttendant, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Auto Attendant') + return i18n.global.t('Auto Attendant') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.auto_attendant } @@ -403,10 +403,10 @@ const routes = [ component: CscPageCustomerPreferences, meta: { get title () { - return i18n.global.tc('PBX Configuration') + return i18n.global.t('PBX Configuration') }, get subtitle () { - return i18n.global.tc('Customer Preferences') + return i18n.global.t('Customer Preferences') } } }, @@ -415,10 +415,10 @@ const routes = [ component: CscPageVoicebox, meta: { get title () { - return i18n.global.tc('Voicebox') + return i18n.global.t('Voicebox') }, get subtitle () { - return i18n.global.tc('Set your voicebox settings') + return i18n.global.t('Set your voicebox settings') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.voiceMail } @@ -428,10 +428,10 @@ const routes = [ component: CscPageFaxSettings, meta: { get title () { - return i18n.global.tc('Fax Settings') + return i18n.global.t('Fax Settings') }, get subtitle () { - return i18n.global.tc('Set your fax settings') + return i18n.global.t('Set your fax settings') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.faxServer, license: LICENSES.fax @@ -442,10 +442,10 @@ const routes = [ component: CscPageUserSettings, meta: { get title () { - return i18n.global.tc('User settings') + return i18n.global.t('User settings') }, get subtitle () { - return i18n.global.tc('Change password') + return i18n.global.t('Change password') } } }, @@ -454,10 +454,10 @@ const routes = [ component: CscPageCallSettings, meta: { get title () { - return i18n.global.tc('Call Settings') + return i18n.global.t('Call Settings') }, get subtitle () { - return i18n.global.tc('Call Settings') + return i18n.global.t('Call Settings') }, profileAttributes: PROFILE_ATTRIBUTES_MAP.callSettings } @@ -467,10 +467,10 @@ const routes = [ component: CscPagePbxSettingsCallQueues, meta: { get title () { - return i18n.global.tc('Extension Settings') + return i18n.global.t('Extension Settings') }, get subtitle () { - return i18n.global.tc('Call Queues') + return i18n.global.t('Call Queues') }, profileAttributes: PROFILE_ATTRIBUTES_MAP.extSettingsCallQueue } @@ -480,10 +480,10 @@ const routes = [ component: CscPagePbxSettingsMsConfigs, meta: { get title () { - return i18n.global.tc('Extension Settings') + return i18n.global.t('Extension Settings') }, get subtitle () { - return i18n.global.tc('Manager Secretary') + return i18n.global.t('Manager Secretary') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.manager_secretary } @@ -493,10 +493,10 @@ const routes = [ component: CscPagePbxSettingsAutoAttendant, meta: { get title () { - return i18n.global.tc('Extension Settings') + return i18n.global.t('Extension Settings') }, get subtitle () { - return i18n.global.tc('Auto Attendant') + return i18n.global.t('Auto Attendant') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.auto_attendant } @@ -507,10 +507,10 @@ const routes = [ component: CscPageRegisteredDevices, meta: { get title () { - return i18n.global.tc('Registered Devices') + return i18n.global.t('Registered Devices') }, get subtitle () { - return i18n.global.tc('List of registered devices for the subscriber') + return i18n.global.t('List of registered devices for the subscriber') }, profileAttribute: PROFILE_ATTRIBUTE_MAP.registeredDevices } @@ -519,8 +519,8 @@ const routes = [ path: '/customer/:pathMatch(.*)', component: () => import('pages/Proxy'), meta: { - title: i18n.global.tc('Customer Details'), - subtitle: i18n.global.tc('Customer Details') + title: i18n.global.t('Customer Details'), + subtitle: i18n.global.t('Customer Details') } }, { @@ -528,7 +528,7 @@ const routes = [ component: CscPageError404, meta: { get title () { - return i18n.global.tc('Page not found') + return i18n.global.t('Page not found') } } } @@ -539,7 +539,7 @@ const routes = [ component: CscPageLogin, meta: { get title () { - return i18n.global.tc('Subscriber Sign In') + return i18n.global.t('Subscriber Sign In') } } }, @@ -558,7 +558,7 @@ const routes = [ props: getToken, meta: { get title () { - return i18n.global.tc('Reset Password') + return i18n.global.t('Reset Password') }, permission: 'public' } @@ -580,7 +580,7 @@ const routes = [ component: CscPageError404, meta: { get title () { - return i18n.global.tc('Page not found') + return i18n.global.t('Page not found') } } } diff --git a/src/store/call-forwarding/actions.js b/src/store/call-forwarding/actions.js index 5d04069d..a3f52c1f 100644 --- a/src/store/call-forwarding/actions.js +++ b/src/store/call-forwarding/actions.js @@ -126,9 +126,9 @@ export async function deleteMapping ({ dispatch, commit, state, rootGetters }, p await cfDeleteDestinationSet(payload.destinationset_id) } catch (e) { if (e.code === 404 && e.message === 'Entity \'cfdestinationset\' not found.') { - // This happens when entity was set by Admin therefore current - // csc user doesn't have rights to delete the entity from DB. - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + // This happens when CF was set by Admin therefore current + // csc user doesn't have rights to delete the entity + showGlobalWarning(i18n.global.t('Entity belongs to admin')) } else { showGlobalError(e.message) } @@ -303,7 +303,7 @@ export async function updateBNumberSet ({ dispatch, commit, rootGetters }, paylo if (e.code === 404 && e.message === 'Entity \'bnumberset\' not found.') { // This happens when entity was set by Admin therefore current // csc user doesn't have rights to edit the entity. - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + showGlobalWarning(i18n.global.t('Entity belongs to admin')) } else { showGlobalError(e.message) } @@ -332,7 +332,7 @@ export async function deleteBNumberSet ({ dispatch, commit, rootGetters, state } // This happens when entity was set by Admin therefore current // csc user doesn't have rights to delete the entity from DB. // In this scenario the b-number is only removed from the mappings. - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + showGlobalWarning(i18n.global.t('Entity belongs to admin')) } else { showGlobalError(e.message) } @@ -421,9 +421,9 @@ export async function updateSourceSet ({ dispatch, commit, rootGetters }, payloa }) } catch (e) { if (e.code === 404 && e.message === 'Entity \'sourceset\' not found.') { - // This happens when entity was set by Admin therefore current - // csc user doesn't have rights to edit the entity. - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + // This happens when CF was set by Admin therefore current + // csc user doesn't have rights to delete the entity + showGlobalWarning(i18n.global.t('Entity belongs to admin')) } else { showGlobalError(e.message) } @@ -452,7 +452,7 @@ export async function deleteSourceSet ({ dispatch, commit, rootGetters, state }, // This happens when entity was set by Admin therefore current // csc user doesn't have rights to delete the entity from DB. // In this scenario the sources is only removed from the mappings. - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + showGlobalWarning(i18n.global.t('Entity belongs to admin')) // Force reload of SourceSets } else { throw e @@ -559,10 +559,9 @@ export async function deleteTimeSet ({ dispatch, commit, rootGetters, state }, p await cfDeleteTimeSet(payload.id) } catch (e) { if (e.code === 404 && e.message === 'Entity \'cftimeset\' not found.') { - // This happens when entity was set by Admin therefore current - // csc user doesn't have rights to delete the entity from DB. - // In this case entity is only removed from the mappings. - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + // This happens when CF was set by Admin therefore current + // csc user doesn't have rights to delete the entity + showGlobalWarning(i18n.global.t('Entity belongs to admin')) } else { showGlobalError(e.message) } @@ -642,9 +641,9 @@ export async function updateTimeSetDateRange ({ dispatch, commit }, payload) { await cfUpdateTimeSetDateRange(payload.id, payload.date) } catch (e) { if (e.code === 404 && e.message === 'Entity \'timeset\' not found.') { - // This happens when entity was set by Admin therefore current - // csc user doesn't have rights to edit the entity - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + // This happens when CF was set by Admin therefore current + // csc user doesn't have rights to delete the entity + showGlobalWarning(i18n.global.t('Entity belongs to admin')) } else { showGlobalError(e.message) } @@ -682,9 +681,9 @@ export async function updateTimeSetWeekdays ({ dispatch, commit }, payload) { await cfUpdateTimeSetWeekdays(payload.id, payload.weekdays) } catch (e) { if (e.code === 404 && e.message === 'Entity \'timeset\' not found.') { - // This happens when entity was set by Admin therefore current - // csc user doesn't have rights to edit the entity - showGlobalWarning(i18n.global.tc('Entity belongs to admin')) + // This happens when CF was set by Admin therefore current + // csc user doesn't have rights to delete the entity + showGlobalWarning(i18n.global.t('Entity belongs to admin')) } else { showGlobalError(e.message) } diff --git a/src/store/call/actions.js b/src/store/call/actions.js index 5dcdd878..30d3b0e3 100644 --- a/src/store/call/actions.js +++ b/src/store/call/actions.js @@ -35,7 +35,7 @@ export default { context.commit('localMediaSuccess', callGetLocalMediaStreamId()) } else { context.commit('inputNumber') - showGlobalError(i18n.global.tc('No microphone authorized.')) + showGlobalError(i18n.global.t('No microphone authorized.')) } }, async accept (context, localMedia) { diff --git a/src/store/call/common.js b/src/store/call/common.js index a82fa2e9..44daacda 100644 --- a/src/store/call/common.js +++ b/src/store/call/common.js @@ -12,25 +12,25 @@ export const CallState = { } export const CallStateTitle = { get input () { - return i18n.global.tc('Start new call') + return i18n.global.t('Start new call') }, get initiating () { - return i18n.global.tc('Calling') + return i18n.global.t('Calling') }, get ringing () { - return i18n.global.tc('Ringing at') + return i18n.global.t('Ringing at') }, get incoming () { - return i18n.global.tc('Incoming call from') + return i18n.global.t('Incoming call from') }, get established () { - return i18n.global.tc('In call with') + return i18n.global.t('In call with') }, get ended () { - return i18n.global.tc('Call ended') + return i18n.global.t('Call ended') }, get hold () { - return i18n.global.tc('Call holded') + return i18n.global.t('Call holded') } } diff --git a/src/store/communication.js b/src/store/communication.js index 51a69a44..fc0b433c 100644 --- a/src/store/communication.js +++ b/src/store/communication.js @@ -17,7 +17,7 @@ export default { }, createFaxError (state) { return state.createFaxError || - i18n.global.tc('An error occured while trying to send the fax. Please try again') + i18n.global.t('An error occured while trying to send the fax. Please try again') } }, mutations: { diff --git a/src/store/conversations/getters.js b/src/store/conversations/getters.js index 876fc140..a9737e14 100644 --- a/src/store/conversations/getters.js +++ b/src/store/conversations/getters.js @@ -10,7 +10,7 @@ export default { }, reloadItemsError (state) { return state.reloadItemsError || - i18n.global.tc('Reloading conversation items failed') + i18n.global.t('Reloading conversation items failed') }, playVoiceMailState (state) { return (id) => { diff --git a/src/store/pbx-callqueues.js b/src/store/pbx-callqueues.js index 864b18b2..e8ac5ee8 100644 --- a/src/store/pbx-callqueues.js +++ b/src/store/pbx-callqueues.js @@ -66,7 +66,7 @@ export default { }, getCallQueueRemoveDialogMessage (state) { if (state.callQueueRemoving !== null) { - return i18n.global.tc('You are about to remove call queue for {subscriber}', { + return i18n.global.t('You are about to remove call queue for {subscriber}', { subscriber: state.subscriberMap[state.callQueueRemoving.id].display_name }) } @@ -88,18 +88,18 @@ export default { return state.callQueueUpdatingField }, getCallQueueCreationToastMessage (state, getters) { - return i18n.global.tc('Created call queue for {callQueue} successfully', { + return i18n.global.t('Created call queue for {callQueue} successfully', { callQueue: getters.getCallQueueCreatingName }) }, getCallQueueUpdateToastMessage (state, getters) { - return i18n.global.tc('Updated {field} for call queue {callQueue} successfully', { + return i18n.global.t('Updated {field} for call queue {callQueue} successfully', { callQueue: getters.getCallQueueUpdatingName, field: getters.getCallQueueUpdatingField }) }, getCallQueueRemovalToastMessage (state, getters) { - return i18n.global.tc('Removed call queue for {callQueue} successfully', { + return i18n.global.t('Removed call queue for {callQueue} successfully', { callQueue: getters.getCallQueueRemovingName }) } diff --git a/src/store/pbx-devices.js b/src/store/pbx-devices.js index b5fc7654..4a29431a 100644 --- a/src/store/pbx-devices.js +++ b/src/store/pbx-devices.js @@ -49,12 +49,12 @@ export default { return _.get(state, 'deviceCreating.stationName', '') }, getDeviceCreationToastMessage (state, getters) { - return i18n.global.tc('Created device {device} successfully', { + return i18n.global.t('Created device {device} successfully', { device: getters.getDeviceCreatingName }) }, getDevicePreferencesUpdateToastMessage (state, getters) { - return i18n.global.tc('Updated {field} successfully', { + return i18n.global.t('Updated {field} successfully', { field: getters.getDevicePreferencesUpdatingField }) }, @@ -66,7 +66,7 @@ export default { }, getDeviceRemoveDialogMessage (state, getters) { if (getters.isDeviceRemoving) { - return i18n.global.tc('You are about to remove device {device}', { + return i18n.global.t('You are about to remove device {device}', { device: getters.getDeviceRemovingName }) } @@ -76,12 +76,12 @@ export default { return _.get(state, 'deviceRemoving.station_name', '') }, getDeviceRemovalToastMessage (state, getters) { - return i18n.global.tc('Removed device {device} successfully', { + return i18n.global.t('Removed device {device} successfully', { device: getters.getDeviceRemovingName }) }, getDeviceUpdateToastMessage (state, getters) { - return i18n.global.tc('Updated {field} for device {device} successfully', { + return i18n.global.t('Updated {field} for device {device} successfully', { device: getters.getDeviceUpdatingName, field: getters.getDeviceUpdatingField }) @@ -340,7 +340,7 @@ export default { setDeviceStationName (context, options) { context.commit('deviceUpdateRequesting', { deviceId: options.deviceId, - deviceField: i18n.global.tc('Station name') + deviceField: i18n.global.t('Station name') }) setDeviceStationName(options.deviceId, options.stationName).then((device) => { context.commit('deviceUpdateSucceeded', device) @@ -351,7 +351,7 @@ export default { setDeviceIdentifier (context, options) { context.commit('deviceUpdateRequesting', { deviceId: options.deviceId, - deviceField: i18n.global.tc('MAC address') + deviceField: i18n.global.t('MAC address') }) setDeviceIdentifier(options.deviceId, options.identifier).then((device) => { context.commit('deviceUpdateSucceeded', device) @@ -362,7 +362,7 @@ export default { setDeviceProfile (context, options) { context.commit('deviceUpdateRequesting', { deviceId: options.deviceId, - deviceField: i18n.global.tc('Phone model') + deviceField: i18n.global.t('Phone model') }) setDeviceProfile(options.deviceId, options.profileId).then((device) => { context.commit('deviceUpdateSucceeded', device) @@ -373,7 +373,7 @@ export default { setDeviceKeys (context, options) { context.commit('deviceUpdateRequesting', { deviceId: options.deviceId, - deviceField: i18n.global.tc('Lamps/Keys') + deviceField: i18n.global.t('Lamps/Keys') }) setDeviceKeys(options.deviceId, options.keys).then((device) => { context.commit('deviceUpdateSucceeded', device) @@ -384,7 +384,7 @@ export default { setAdminName (context, options) { context.commit('devicePreferencesUpdateRequesting', { deviceId: options.deviceId, - devicePreferencesField: i18n.global.tc('Admin name') + devicePreferencesField: i18n.global.t('Admin name') }) setPreferenceDevice(options.deviceId, options.adminName, 'admin_name').then((device) => { context.commit('devicePreferencesUpdateSucceeded', device) @@ -395,7 +395,7 @@ export default { setFW (context, options) { context.commit('devicePreferencesUpdateRequesting', { deviceId: options.deviceId, - devicePreferencesField: i18n.global.tc('FW Upgrade disable') + devicePreferencesField: i18n.global.t('FW Upgrade disable') }) setPreferenceDevice(options.deviceId, options.FWupg, 'FW_upg_dis').then((device) => { context.commit('devicePreferencesUpdateSucceeded', device) @@ -406,7 +406,7 @@ export default { setGui (context, options) { context.commit('devicePreferencesUpdateRequesting', { deviceId: options.deviceId, - devicePreferencesField: i18n.global.tc('Disable phone web interface') + devicePreferencesField: i18n.global.t('Disable phone web interface') }) setPreferenceDevice(options.deviceId, options.webGui, 'web_gui_dis').then((device) => { context.commit('devicePreferencesUpdateSucceeded', device) @@ -417,7 +417,7 @@ export default { setUserConfig (context, options) { context.commit('devicePreferencesUpdateRequesting', { deviceId: options.deviceId, - devicePreferencesField: i18n.global.tc('User config priority over provisioning') + devicePreferencesField: i18n.global.t('User config priority over provisioning') }) setPreferenceDevice(options.deviceId, options.userConf, 'user_conf_priority').then((device) => { context.commit('devicePreferencesUpdateSucceeded', device) diff --git a/src/store/pbx-groups.js b/src/store/pbx-groups.js index 15c80e85..9d05bab9 100644 --- a/src/store/pbx-groups.js +++ b/src/store/pbx-groups.js @@ -89,24 +89,24 @@ export default { }, getGroupRemoveDialogMessage (state, getters) { if (getters.isGroupRemoving) { - return i18n.global.tc('You are about to remove group {group}', { + return i18n.global.t('You are about to remove group {group}', { group: getters.getGroupRemovingName }) } return '' }, getGroupCreationToastMessage (state, getters) { - return i18n.global.tc('Added group {group}', { + return i18n.global.t('Added group {group}', { group: getters.getGroupCreatingName }) }, getGroupUpdateToastMessage (state, getters) { - return i18n.global.tc('Changed {field} successfully', { + return i18n.global.t('Changed {field} successfully', { field: getters.getGroupUpdatingField }) }, getGroupRemovalToastMessage (state, getters) { - return i18n.global.tc('Removed group {group}', { + return i18n.global.t('Removed group {group}', { group: getters.getGroupRemovingName }) }, @@ -123,19 +123,19 @@ export default { getHuntPolicyOptions () { return [ { - label: i18n.global.tc('Serial Ringing'), + label: i18n.global.t('Serial Ringing'), value: 'serial' }, { - label: i18n.global.tc('Parallel Ringing'), + label: i18n.global.t('Parallel Ringing'), value: 'parallel' }, { - label: i18n.global.tc('Random Ringing'), + label: i18n.global.t('Random Ringing'), value: 'random' }, { - label: i18n.global.tc('Circular Ringing'), + label: i18n.global.t('Circular Ringing'), value: 'circular' } ] @@ -148,11 +148,11 @@ export default { getHuntCancelModeOptions () { return [ { - label: i18n.global.tc('Using Cancel'), + label: i18n.global.t('Using Cancel'), value: 'cancel' }, { - label: i18n.global.tc('Using Bye'), + label: i18n.global.t('Using Bye'), value: 'bye' } ] @@ -318,7 +318,7 @@ export default { setGroupName (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Group Name') + groupField: i18n.global.t('Group Name') }) setGroupName({ groupId: options.groupId, @@ -332,7 +332,7 @@ export default { setGroupExtension (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Extension') + groupField: i18n.global.t('Extension') }) setGroupExtension({ groupId: options.groupId, @@ -346,7 +346,7 @@ export default { setGroupHuntPolicy (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Hunt Policy') + groupField: i18n.global.t('Hunt Policy') }) setGroupHuntPolicy({ groupId: options.groupId, @@ -360,7 +360,7 @@ export default { setGroupHuntTimeout (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Hunt Policy') + groupField: i18n.global.t('Hunt Policy') }) setGroupHuntTimeout({ groupId: options.groupId, @@ -374,7 +374,7 @@ export default { setGroupHuntCancelMode (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Hunt Cancel Mode') + groupField: i18n.global.t('Hunt Cancel Mode') }) setGroupHuntCancelMode({ groupId: options.groupId, @@ -388,7 +388,7 @@ export default { setGroupNumbers (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Alias Numbers') + groupField: i18n.global.t('Alias Numbers') }) setGroupNumbers({ groupId: options.groupId, @@ -404,7 +404,7 @@ export default { setGroupSeats (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Seats') + groupField: i18n.global.t('Seats') }) setGroupSeats({ groupId: options.groupId, @@ -418,7 +418,7 @@ export default { setGroupSoundSet (context, options) { context.commit('groupUpdateRequesting', { groupId: options.groupId, - groupField: i18n.global.tc('Sound Set') + groupField: i18n.global.t('Sound Set') }) setGroupSoundSet({ groupId: options.groupId, diff --git a/src/store/pbx-ms-configs.js b/src/store/pbx-ms-configs.js index 9e131791..5b807fea 100644 --- a/src/store/pbx-ms-configs.js +++ b/src/store/pbx-ms-configs.js @@ -63,7 +63,7 @@ export default { }, getMsConfigRemoveDialogMessage (state) { if (state.msConfigRemoving !== null) { - return i18n.global.tc('You are about to remove config for {msConfig}', { + return i18n.global.t('You are about to remove config for {msConfig}', { msConfig: state.subscriberMap[state.msConfigRemoving.id].display_name }) } @@ -85,18 +85,18 @@ export default { return state.msConfigUpdatingField }, getMsConfigCreationToastMessage (state, getters) { - return i18n.global.tc('Created manager secretary config for {msConfig} successfully', { + return i18n.global.t('Created manager secretary config for {msConfig} successfully', { msConfig: getters.getMsConfigCreatingName }) }, getMsConfigUpdateToastMessage (state, getters) { - return i18n.global.tc('Updated {field} for manager secretary config {msConfig} successfully', { + return i18n.global.t('Updated {field} for manager secretary config {msConfig} successfully', { msConfig: getters.getMsConfigUpdatingName, field: getters.getMsConfigUpdatingField }) }, getMsConfigRemovalToastMessage (state, getters) { - return i18n.global.tc('Removed manager secretary config for {msConfig} successfully', { + return i18n.global.t('Removed manager secretary config for {msConfig} successfully', { msConfig: getters.getMsConfigRemovingName }) } @@ -237,7 +237,7 @@ export default { setSecretaryNumbers (context, options) { context.commit('msConfigUpdateRequesting', { msConfigId: options.msConfigId, - field: i18n.global.tc('Secretary numbers') + field: i18n.global.t('Secretary numbers') }) setSecretaryNumber(options).then((preferences) => { context.commit('msConfigUpdateSucceeded', preferences) diff --git a/src/store/pbx-seats.js b/src/store/pbx-seats.js index 9b0276cf..cb503243 100644 --- a/src/store/pbx-seats.js +++ b/src/store/pbx-seats.js @@ -181,24 +181,24 @@ export default { }, getSeatRemoveDialogMessage (state, getters) { if (state.seatRemoving !== null) { - return i18n.global.tc('You are about to remove seat {seat}', { + return i18n.global.t('You are about to remove seat {seat}', { seat: getters.getSeatRemovingName }) } return '' }, getSeatCreationToastMessage (state, getters) { - return i18n.global.tc('Added seat {seat}', { + return i18n.global.t('Added seat {seat}', { seat: getters.getSeatCreatingName }) }, getSeatUpdateToastMessage (state, getters) { - return i18n.global.tc('Changed {field} successfully', { + return i18n.global.t('Changed {field} successfully', { field: getters.getSeatUpdatingField }) }, getSeatRemovalToastMessage (state, getters) { - return i18n.global.tc('Removed seat {seat}', { + return i18n.global.t('Removed seat {seat}', { seat: getters.getSeatRemovingName }) }, @@ -387,7 +387,7 @@ export default { setSeatDisplayName (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Seat displayName') + seatField: i18n.global.t('Seat displayName') }) setSeatDisplayName({ seatId: options.seatId, @@ -401,7 +401,7 @@ export default { setSeatWebUsername (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Seat Web Username') + seatField: i18n.global.t('Seat Web Username') }) setSeatWebUsername({ seatId: options.seatId, @@ -415,7 +415,7 @@ export default { setSeatExtension (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Extension') + seatField: i18n.global.t('Extension') }) setSeatExtension({ seatId: options.seatId, @@ -429,7 +429,7 @@ export default { setSeatWebPassword (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Password') + seatField: i18n.global.t('Password') }) setSeatWebPassword({ seatId: options.seatId, @@ -443,7 +443,7 @@ export default { setSeatSIPPassword (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('SIP Password') + seatField: i18n.global.t('SIP Password') }) setSeatSIPPassword({ seatId: options.seatId, @@ -457,7 +457,7 @@ export default { setSeatGroups (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Groups') + seatField: i18n.global.t('Groups') }) setSeatGroups({ seatId: options.seatId, @@ -471,7 +471,7 @@ export default { setSeatNumbers (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Alias Numbers') + seatField: i18n.global.t('Alias Numbers') }) setSeatNumbers({ seatId: options.seatId, @@ -489,7 +489,7 @@ export default { setSeatSoundSet (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Sound Set') + seatField: i18n.global.t('Sound Set') }) setSeatSoundSet({ seatId: options.seatId, @@ -503,7 +503,7 @@ export default { setNcosSet (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Ncos') + seatField: i18n.global.t('Ncos') }) setNcosSet({ seatId: options.seatId, @@ -517,7 +517,7 @@ export default { NcosSet (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: i18n.global.tc('Ncos Set') + seatField: i18n.global.t('Ncos Set') }) NcosSet({ seatId: options.seatId, @@ -531,7 +531,7 @@ export default { setNcosLevelSet (context, options) { context.commit('seatUpdateRequesting', { seatId: getSubscriberId(), - seatField: i18n.global.tc('Ncos') + seatField: i18n.global.t('Ncos') }) setNcosLevelSets({ seatId: getSubscriberId(), @@ -545,7 +545,7 @@ export default { setNcosSets (context, options) { context.commit('seatUpdateRequesting', { seatId: getSubscriberId(), - seatField: i18n.global.tc('Ncos Set') + seatField: i18n.global.t('Ncos Set') }) NcosSets({ seatId: getSubscriberId(), @@ -559,7 +559,7 @@ export default { async setIntraPbx (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('the visibility of the number within own PBX') + seatField: options.message || i18n.global.t('the visibility of the number within own PBX') }) try { const result = await setSeatIntraPbx(options.seatId, options.intraPbx) @@ -571,7 +571,7 @@ export default { async setMusicOnHold (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('music on hold of the seat') + seatField: options.message || i18n.global.t('music on hold of the seat') }) try { const result = await setSeatMusicOnHold(options.seatId, options.musicOnHold) @@ -583,7 +583,7 @@ export default { async setCli (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('cli of the seat') + seatField: options.message || i18n.global.t('cli of the seat') }) try { const result = await setSeatCli(options.seatId, options.cli) @@ -595,7 +595,7 @@ export default { async setAnnouncementCfu (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('the playback announcement as early media before Call Forward Unconditional or Unavailable') + seatField: options.message || i18n.global.t('the playback announcement as early media before Call Forward Unconditional or Unavailable') }) try { const result = await setSeatAnnouncementCfu(options.seatId, options.announcementCfu) @@ -607,7 +607,7 @@ export default { async setAnnouncementCallSetup (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('the playback announcement as early media before send the call to callee') + seatField: options.message || i18n.global.t('the playback announcement as early media before send the call to callee') }) try { const result = await setSeatAnnouncementCallSetup(options.seatId, options.announcementCallSetup) @@ -619,7 +619,7 @@ export default { async setAnnouncementToCallee (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('the playback announcement to callee after he answered the call') + seatField: options.message || i18n.global.t('the playback announcement to callee after he answered the call') }) try { const result = await setSeatAnnouncementToCallee(options.seatId, options.announcementToCallee) @@ -631,7 +631,7 @@ export default { async setIgnoreCfWhenHunting (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('the behavior of the members call forwards from a Cloud PBX subscriber when it is called within a huntgroup') + seatField: options.message || i18n.global.t('the behavior of the members call forwards from a Cloud PBX subscriber when it is called within a huntgroup') }) try { const result = await setSeatIgnoreCfWhenHunting(options.seatId, options.ignoreCfWhenHunting) @@ -643,7 +643,7 @@ export default { async setCstaClient (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('the right of this subscriber to be controlled by a CTI subscriber within the same customer using uaCSTA via SIP') + seatField: options.message || i18n.global.t('the right of this subscriber to be controlled by a CTI subscriber within the same customer using uaCSTA via SIP') }) try { const result = await setSeatCstaClient(options.seatId, options.cstaClient) @@ -655,7 +655,7 @@ export default { async setCstaController (context, options) { context.commit('seatUpdateRequesting', { seatId: options.seatId, - seatField: options.message || i18n.global.tc('the right this subscriber to initiate CTI sessions to other subscribers within the same customer using uaCSTA via SIP') + seatField: options.message || i18n.global.t('the right this subscriber to initiate CTI sessions to other subscribers within the same customer using uaCSTA via SIP') }) try { const result = await setSeatCstaController(options.seatId, options.cstaController) diff --git a/src/store/pbx-soundsets.js b/src/store/pbx-soundsets.js index 4568f5f9..2b6e8f69 100644 --- a/src/store/pbx-soundsets.js +++ b/src/store/pbx-soundsets.js @@ -94,7 +94,7 @@ export default { getSoundSetRemoveDialogMessage (state) { if (state.soundSetRemoving !== null) { const id = _.get(state, 'soundSetRemoving.id', null) - return i18n.global.tc('You are about to remove sound set {soundSetName}', { + return i18n.global.t('You are about to remove sound set {soundSetName}', { soundSetName: _.get(state, `soundSetMap.${id}.name`, null) }) } @@ -113,18 +113,18 @@ export default { return state.soundSetUpdatingField }, getSoundSetCreationToastMessage (state, getters) { - return i18n.global.tc('Created sound set {soundSet} successfully', { + return i18n.global.t('Created sound set {soundSet} successfully', { soundSet: getters.getSoundSetCreatingName }) }, getSoundSetUpdateToastMessage (state, getters) { - return i18n.global.tc('Updated {field} for sound set {soundSet} successfully', { + return i18n.global.t('Updated {field} for sound set {soundSet} successfully', { soundSet: getters.getSoundSetUpdatingName, field: getters.getSoundSetUpdatingField }) }, getSoundSetRemovalToastMessage (state, getters) { - return i18n.global.tc('Removed sound set {soundSet} successfully', { + return i18n.global.t('Removed sound set {soundSet} successfully', { soundSet: getters.getSoundSetRemovingName }) }, @@ -408,7 +408,7 @@ export default { setAsDefaultSoundSet (context, options) { context.commit('soundSetUpdateRequesting', { soundSetId: options.soundSetId, - field: i18n.global.tc('default option') + field: i18n.global.t('default option') }) let func = setAsDefault if (options.contractDefault !== true) { @@ -423,7 +423,7 @@ export default { setSoundSetName (context, options) { context.commit('soundSetUpdateRequesting', { soundSetId: options.soundSetId, - field: i18n.global.tc('name') + field: i18n.global.t('name') }) setSoundSetName(options.soundSetId, options.name).then((soundSet) => { context.commit('soundSetUpdateSucceeded', soundSet) @@ -434,7 +434,7 @@ export default { setSoundSetDescription (context, options) { context.commit('soundSetUpdateRequesting', { soundSetId: options.soundSetId, - field: i18n.global.tc('description') + field: i18n.global.t('description') }) setSoundSetDescription(options.soundSetId, options.description).then((soundSet) => { context.commit('soundSetUpdateSucceeded', soundSet) @@ -445,7 +445,7 @@ export default { setSoundSetParent (context, options) { context.commit('soundSetUpdateRequesting', { soundSetId: options.soundSetId, - field: i18n.global.tc('parent') + field: i18n.global.t('parent') }) setSoundSetParent(options.soundSetId, options.parent_id).then((soundSet) => { context.commit('soundSetUpdateSucceeded', soundSet) diff --git a/src/store/pbx.js b/src/store/pbx.js index c560d6a5..af01fdb9 100644 --- a/src/store/pbx.js +++ b/src/store/pbx.js @@ -98,7 +98,7 @@ export default { }, getSoundSetOptions (state) { const options = [] - const defaultLabel = i18n.global.tc('Default') + const defaultLabel = i18n.global.t('Default') state.soundSetList.forEach((soundSet) => { options.push({ label: soundSet.name, @@ -124,7 +124,7 @@ export default { getSubscriberOptions (state) { const options = [] options.push({ - label: i18n.global.tc('Unassigned'), + label: i18n.global.t('Unassigned'), icon: 'clear', value: null, type: null @@ -166,15 +166,15 @@ export default { const min = getters.getMinAllowedExtension const max = getters.getMaxAllowedExtension if (min >= 0 && max === null) { - return i18n.global.tc('Minimum allowed extension is {min}', { + return i18n.global.t('Minimum allowed extension is {min}', { min }) } else if (min < 0 && max) { - return i18n.global.tc('Maximum allowed extension is {max}', { + return i18n.global.t('Maximum allowed extension is {max}', { max }) } else if (min >= 0 && max) { - return i18n.global.tc('Allowed extensions are between {min} and {max}', { + return i18n.global.t('Allowed extensions are between {min} and {max}', { min, max }) diff --git a/src/store/speed-dial.js b/src/store/speed-dial.js index 51a017a5..ad24b9bb 100644 --- a/src/store/speed-dial.js +++ b/src/store/speed-dial.js @@ -39,13 +39,13 @@ export default { return state.speedDialLoadingState }, speedDialLoadingError (state) { - return state.speedDialLoadingError || i18n.global.tc('An error occured while trying to load the speed dials. Please try again') + return state.speedDialLoadingError || i18n.global.t('An error occured while trying to load the speed dials. Please try again') }, unassignSlotState (state) { return state.unassignSlotState }, unassignSlotError (state) { - return state.unassignSlotError || i18n.global.tc('An error occured while trying to unassign the speed dial slot. Please try again') + return state.unassignSlotError || i18n.global.t('An error occured while trying to unassign the speed dial slot. Please try again') }, lastUnassignedSlot (state) { return state.lastUnassignedSlot @@ -59,7 +59,7 @@ export default { return state.assignSlotState }, assignSlotError (state) { - return state.assignSlotError || i18n.global.tc('An error occured while trying to assign the speed dial slot. Please try again') + return state.assignSlotError || i18n.global.t('An error occured while trying to assign the speed dial slot. Please try again') }, lastAssignedSlot (state) { return state.lastAssignedSlot diff --git a/src/store/voicebox.js b/src/store/voicebox.js index dfa09b88..40ce36f2 100644 --- a/src/store/voicebox.js +++ b/src/store/voicebox.js @@ -113,8 +113,8 @@ export default { }, attachLabel (state, getters) { return state.attachValue - ? i18n.global.tc('Attach voicemail to email notification') - : i18n.global.tc('Attach voicemail to email notification') + ? i18n.global.t('Attach voicemail to email notification') + : i18n.global.t('Attach voicemail to email notification') }, deleteLoading (state, getters) { @@ -122,8 +122,8 @@ export default { }, deleteLabel (state, getters) { return state.deleteValue - ? i18n.global.tc('Delete voicemail after email notification is delivered') - : i18n.global.tc('Delete voicemail after email notification is delivered') + ? i18n.global.t('Delete voicemail after email notification is delivered') + : i18n.global.t('Delete voicemail after email notification is delivered') }, busyGreetingUploading (state) { @@ -134,8 +134,8 @@ export default { }, busyGreetingLabel (state) { return state.busyGreetingId - ? i18n.global.tc('Custom sound') - : i18n.global.tc('Default sound') + ? i18n.global.t('Custom sound') + : i18n.global.t('Default sound') }, busyGreetingDeleting (state) { return state.busyGreetingDeletionState === RequestState.requesting @@ -149,8 +149,8 @@ export default { }, unavailableGreetingLabel (state) { return state.unavailableGreetingId - ? i18n.global.tc('Custom sound') - : i18n.global.tc('Default sound') + ? i18n.global.t('Custom sound') + : i18n.global.t('Default sound') }, unavailableGreetingDeleting (state) { return state.unavailableGreetingDeletionState === RequestState.requesting @@ -163,8 +163,8 @@ export default { }, tempGreetingLabel (state) { return state.tempGreetingId - ? i18n.global.tc('Custom sound') - : i18n.global.tc('Default sound') + ? i18n.global.t('Custom sound') + : i18n.global.t('Default sound') }, tempGreetingDeleting (state) { return state.tempGreetingDeletionState === RequestState.requesting @@ -177,8 +177,8 @@ export default { }, greetGreetingLabel (state) { return state.greetGreetingId - ? i18n.global.tc('Custom sound') - : i18n.global.tc('Default sound') + ? i18n.global.t('Custom sound') + : i18n.global.t('Default sound') }, greetGreetingDeleting (state) { return state.greetGreetingDeletionState === RequestState.requesting diff --git a/src/validators/index.js b/src/validators/index.js index 5bb3afb1..98e319bf 100644 --- a/src/validators/index.js +++ b/src/validators/index.js @@ -1,36 +1,36 @@ import { i18n } from 'boot/i18n' export const errorMessages = { integer () { - return i18n.global.tc('Only none decimal numbers are allowed') + return i18n.global.t('Only none decimal numbers are allowed') }, numeric () { - return i18n.global.tc('Input must be a valid number') + return i18n.global.t('Input must be a valid number') }, required () { - return i18n.global.tc('Input is required') + return i18n.global.t('Input is required') }, passwordDigits () { - return i18n.global.tc('Password is not strong enough, add more digits') + return i18n.global.t('Password is not strong enough, add more digits') }, passwordLowercase () { - return i18n.global.tc('Password is not strong enough, add more lowercase letters') + return i18n.global.t('Password is not strong enough, add more lowercase letters') }, passwordMaxLength (param) { - return i18n.global.tc('Password must be at least {max} characters long', param) + return i18n.global.t('Password must be at least {max} characters long', param) }, passwordMinLength (param) { - return i18n.global.tc('Password must be at least {min} characters long', param) + return i18n.global.t('Password must be at least {min} characters long', param) }, passwordUppercase () { - return i18n.global.tc('Password is not strong enough, add more uppercase letters') + return i18n.global.t('Password is not strong enough, add more uppercase letters') }, passwordChars () { - return i18n.global.tc('Password is not strong enough, add more special characters') + return i18n.global.t('Password is not strong enough, add more special characters') }, passwordStrength () { - return i18n.global.tc('Password is considered weak') + return i18n.global.t('Password is considered weak') }, sameAsPassword () { - return i18n.global.tc('Passwords must be equal') + return i18n.global.t('Passwords must be equal') } } diff --git a/yarn.lock b/yarn.lock index 3c8dc9a2..467cbc11 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1405,26 +1405,26 @@ dependencies: mute-stream "^1.0.0" -"@intlify/core-base@9.14.2": - version "9.14.2" - resolved "https://npm-registry.sipwise.com/@intlify/core-base/-/core-base-9.14.2.tgz#2c074506ea72425e937f911c95c0d845b43f7fdf" - integrity sha512-DZyQ4Hk22sC81MP4qiCDuU+LdaYW91A6lCjq8AWPvY3+mGMzhGDfOCzvyR6YBQxtlPjFqMoFk9ylnNYRAQwXtQ== +"@intlify/core-base@11.0.1": + version "11.0.1" + resolved "https://npm-registry.sipwise.com/@intlify/core-base/-/core-base-11.0.1.tgz#f84564a5bd313879b32cea70e6e3d2fe9e1f128b" + integrity sha512-NAmhw1l/llM0HZRpagR/ChJTNymW4ll6/4EDSJML5c8L5Hl/+k6UyF8EIgE6DeHpfheQujkSRngauViHqq6jJQ== dependencies: - "@intlify/message-compiler" "9.14.2" - "@intlify/shared" "9.14.2" + "@intlify/message-compiler" "11.0.1" + "@intlify/shared" "11.0.1" -"@intlify/message-compiler@9.14.2": - version "9.14.2" - resolved "https://npm-registry.sipwise.com/@intlify/message-compiler/-/message-compiler-9.14.2.tgz#7217842ea1875d80bbf0f708e9b3ef5ad7c57a03" - integrity sha512-YsKKuV4Qv4wrLNsvgWbTf0E40uRv+Qiw1BeLQ0LAxifQuhiMe+hfTIzOMdWj/ZpnTDj4RSZtkXjJM7JDiiB5LQ== +"@intlify/message-compiler@11.0.1": + version "11.0.1" + resolved "https://npm-registry.sipwise.com/@intlify/message-compiler/-/message-compiler-11.0.1.tgz#7c159642e3a3c160dd25a15c17127c69d56b0561" + integrity sha512-5RFH8x+Mn3mbjcHXnb6KCXGiczBdiQkWkv99iiA0JpKrNuTAQeW59Pjq/uObMB0eR0shnKYGTkIJxum+DbL3sw== dependencies: - "@intlify/shared" "9.14.2" + "@intlify/shared" "11.0.1" source-map-js "^1.0.2" -"@intlify/shared@9.14.2": - version "9.14.2" - resolved "https://npm-registry.sipwise.com/@intlify/shared/-/shared-9.14.2.tgz#f7dceea32db44c9253e3f965745a42a5cb3a1883" - integrity sha512-uRAHAxYPeF+G5DBIboKpPgC/Waecd4Jz8ihtkpJQD5ycb5PwXp0k/+hBGl5dAjwF7w+l74kz/PKA8r8OK//RUw== +"@intlify/shared@11.0.1": + version "11.0.1" + resolved "https://npm-registry.sipwise.com/@intlify/shared/-/shared-11.0.1.tgz#25ff7f038bbae903e2bc75bf862b2380fde07cc8" + integrity sha512-lH164+aDDptHZ3dBDbIhRa1dOPQUp+83iugpc+1upTOWCnwyC1PVis6rSWNMMJ8VQxvtHQB9JMib48K55y0PvQ== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -11735,13 +11735,13 @@ vue-eslint-parser@^9.4.3: lodash "^4.17.21" semver "^7.3.6" -vue-i18n@9.14.2: - version "9.14.2" - resolved "https://npm-registry.sipwise.com/vue-i18n/-/vue-i18n-9.14.2.tgz#e7f657664fcb3ccf99ecea684fc56e0f8e5335ce" - integrity sha512-JK9Pm80OqssGJU2Y6F7DcM8RFHqVG4WkuCqOZTVsXkEzZME7ABejAUqUdA931zEBedc4thBgSUWxeQh4uocJAQ== +vue-i18n@11.0.1: + version "11.0.1" + resolved "https://npm-registry.sipwise.com/vue-i18n/-/vue-i18n-11.0.1.tgz#aa4c20d6f7c127bc46028ae3325659be47dd338e" + integrity sha512-pWAT8CusK8q9/EpN7V3oxwHwxWm6+Kp2PeTZmRGvdZTkUzMQDpbbmHp0TwQ8xw04XKm23cr6B4GL72y3W8Yekg== dependencies: - "@intlify/core-base" "9.14.2" - "@intlify/shared" "9.14.2" + "@intlify/core-base" "11.0.1" + "@intlify/shared" "11.0.1" "@vue/devtools-api" "^6.5.0" vue-jscodeshift-adapter@^2.2.1: