From d02f82e69c6fb8ded20600ceff630bdef1e565b9 Mon Sep 17 00:00:00 2001 From: Sergii Leonenko Date: Tue, 22 Dec 2020 20:38:31 +0200 Subject: [PATCH] TT#105551 Convert key based i18n translations to gettext based ones AC: Can see the keys replaced by the actual english translation in the code Can see the language files, including the english one, using the english translation as keys Can see no more nested structure but flat a one only Change-Id: I3c3fc18ff91d972cb592c8cab43b66da16193a1c --- README.md | 8 +- src/api/call-forward.js | 14 +- src/api/fax.js | 4 +- src/api/speed-dial.js | 2 +- src/boot/constants.js | 6 +- src/boot/routes.js | 2 +- src/boot/vuelidate.js | 2 +- src/components/CscChangePasswordDialog.vue | 4 +- src/components/CscConfirmationDialog.vue | 2 +- src/components/CscDialog.vue | 2 +- src/components/CscDialogChangePassword.vue | 4 +- src/components/CscMainMenuNewFeatures.vue | 4 +- src/components/CscMainMenuTop.vue | 32 +- src/components/CscPopupMenuItemDelete.vue | 2 +- src/components/CscPopupMenuItemStartCall.vue | 2 +- src/components/CscRemoveDialog.vue | 2 +- src/components/CscRetrievePasswordDialog.vue | 8 +- src/components/CscSendFax.vue | 44 +- src/components/CscTimeRange.vue | 10 +- src/components/CscUserMenu.vue | 6 +- src/components/Error404.vue | 2 +- .../CscCfGroupConditionMenu.vue | 2 +- .../CscCfGroupConditionSourceSetCreate.vue | 2 +- .../CscCfGroupConditionSourceSetSelect.vue | 2 +- .../CscCfSelectionWeekdays.vue | 4 +- src/components/call/CscCall.vue | 14 +- src/components/call/CscPhoneNumberInput.vue | 14 +- src/components/form/CscCallInput.vue | 6 +- src/components/form/CscChangePasswordForm.vue | 8 +- src/components/form/CscFormResetButton.vue | 2 +- src/components/form/CscFormSaveButton.vue | 2 +- src/components/form/CscInputButtonReset.vue | 2 +- src/components/form/CscInputButtonSave.vue | 2 +- src/components/form/CscInputFile.vue | 4 +- .../form/CscInputPasswordRetype.vue | 6 +- src/components/form/CscInputSaveable.vue | 4 +- src/components/form/CscSoundFileUpload.vue | 12 +- .../pages/CallBlocking/CscBlockedNumber.vue | 4 +- .../pages/CallBlocking/CscCallBlocking.vue | 46 +- .../CallBlocking/CscCallBlockingAddForm.vue | 10 +- .../CallForward/CscAddDestinationForm.vue | 32 +- .../pages/CallForward/CscAddTimeForm.vue | 20 +- .../CscCallForwardDestinations.vue | 14 +- .../pages/CallForward/CscCallForwardTime.vue | 2 +- .../pages/CallForward/CscCallForwardTimes.vue | 2 +- .../CallForward/CscCallForwardTimeset.vue | 22 +- .../pages/CallForward/CscDestination.vue | 46 +- .../pages/CallForward/CscDestinations.vue | 64 +- .../pages/CallForward/CscSourcesets.vue | 40 +- .../pages/CallForward/CscSourcesetsForm.vue | 6 +- .../pages/Conference/CscConferenceJoin.vue | 8 +- .../CscConferenceRemoteParticipant.vue | 4 +- .../Conference/CscShareConferenceDialog.vue | 4 +- .../pages/Conversations/CscCallItem.vue | 12 +- .../pages/Conversations/CscCallOptionList.vue | 6 +- .../Conversations/CscConversationItem.vue | 12 +- .../pages/Conversations/CscFaxItem.vue | 8 +- .../pages/Conversations/CscVoiceMailItem.vue | 8 +- .../FaxSettings/CscFaxToMailDestination.vue | 4 +- .../CscFaxToMailDestinationForm.vue | 20 +- .../FaxSettings/CscFaxToMailSettings.vue | 18 +- .../pages/FaxSettings/CscMailToFaxACLForm.vue | 4 +- .../CscMailToFaxRenewNotifyEmail.vue | 8 +- .../CscMailToFaxRenewNotifyEmailForm.vue | 4 +- .../FaxSettings/CscMailToFaxSettings.vue | 20 +- .../NewCallForward/CscCallForwardGroup.vue | 71 +- .../CscNewCallForwardAddDestinationForm.vue | 8 +- .../CscNewCallForwardAddOfficeHoursForm.vue | 20 +- .../CscNewCallForwardAddSourcesetForm.vue | 10 +- .../CscNewCallForwardAddWeekdayForm.vue | 10 +- .../CscNewCallForwardDateRange.vue | 26 +- .../CscNewCallForwardDestination.vue | 20 +- .../CscNewCallForwardDestinationTypeForm.vue | 4 +- ...NewCallForwardDestinationsetTypeSelect.vue | 6 +- .../CscNewCallForwardEditSources.vue | 12 +- .../CscPbxAttendantSelection.vue | 8 +- .../PbxConfiguration/CscPbxCallQueue.vue | 36 +- .../CscPbxCallQueueAddForm.vue | 36 +- .../pages/PbxConfiguration/CscPbxDevice.vue | 10 +- .../PbxConfiguration/CscPbxDeviceAddForm.vue | 22 +- .../PbxConfiguration/CscPbxDeviceConfig.vue | 12 +- .../PbxConfiguration/CscPbxDeviceFilters.vue | 20 +- .../pages/PbxConfiguration/CscPbxGroup.vue | 26 +- .../PbxConfiguration/CscPbxGroupAddForm.vue | 56 +- .../PbxConfiguration/CscPbxGroupFilters.vue | 12 +- .../PbxConfiguration/CscPbxModelSelect.vue | 2 +- .../pages/PbxConfiguration/CscPbxMsConfig.vue | 8 +- .../CscPbxMsConfigAddForm.vue | 8 +- .../pages/PbxConfiguration/CscPbxSeat.vue | 28 +- .../PbxConfiguration/CscPbxSeatAddForm.vue | 44 +- .../PbxConfiguration/CscPbxSeatFilters.vue | 24 +- .../pages/PbxConfiguration/CscPbxSoundSet.vue | 10 +- .../CscPbxSoundSetAddForm.vue | 32 +- .../pages/SpeedDial/CscSpeedDialAddForm.vue | 14 +- .../pages/UserSettings/CscChangePassword.vue | 14 +- .../pages/Voicebox/CscVoiceboxSettings.vue | 18 +- src/filters/date.js | 26 +- src/helpers/ui.js | 10 +- src/i18n/de.json | 1086 ++++++------- src/i18n/en.json | 1393 +++++++---------- src/i18n/es.json | 1072 ++++++------- src/i18n/fr.json | 862 +++++----- src/i18n/index.js | 27 +- src/i18n/it.json | 1080 ++++++------- src/layouts/CscLayoutConference.vue | 8 +- src/layouts/CscLayoutMain.vue | 10 +- src/mixins/alias-number-options.js | 10 +- src/pages/CscPageCallBlockingPrivacy.vue | 8 +- src/pages/CscPageCallForwardAlways.vue | 2 +- src/pages/CscPageCallSettings.vue | 8 +- src/pages/CscPageConversations.vue | 28 +- src/pages/CscPageError404.vue | 2 +- src/pages/CscPageHome.vue | 4 +- src/pages/CscPageLogin.vue | 14 +- src/pages/CscPageNewCallForward.vue | 8 +- src/pages/CscPagePbxCallQueues.vue | 6 +- src/pages/CscPagePbxDevices.vue | 12 +- src/pages/CscPagePbxGroups.vue | 12 +- src/pages/CscPagePbxMsConfigs.vue | 6 +- src/pages/CscPagePbxSeats.vue | 10 +- src/pages/CscPagePbxSettings.vue | 6 +- src/pages/CscPagePbxSoundSets.vue | 6 +- src/pages/CscPageReminder.vue | 24 +- src/pages/CscPageSpeedDial.vue | 16 +- src/pages/CscPageUserSettings.vue | 2 +- src/pages/CscPageVoicebox.vue | 34 +- src/pages/CscRecoverPassword.vue | 6 +- src/router/routes.js | 84 +- src/store/call-forward.js | 26 +- src/store/call.js | 10 +- src/store/communication.js | 2 +- src/store/conversations/getters.js | 2 +- src/store/index.js | 2 +- src/store/pbx-callqueues.js | 16 +- src/store/pbx-devices.js | 16 +- src/store/pbx-groups.js | 30 +- src/store/pbx-ms-configs.js | 18 +- src/store/pbx-seats.js | 22 +- src/store/pbx-soundsets.js | 14 +- src/store/pbx.js | 12 +- src/store/speed-dial.js | 6 +- src/store/voicebox.js | 16 +- t/api/call-forward.js | 20 +- t/api/speed-dial.js | 14 +- t/store/voicebox.js | 4 +- 145 files changed, 3386 insertions(+), 4049 deletions(-) diff --git a/README.md b/README.md index 83f031ee..5558879d 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ In order to add a new page you need to go along the following steps: path: '/user/new-feature', component: CscPageNewFeature, meta: { - title: i18n.t('pages.newFeature.title'), - subtitle: i18n.t('navigation.newFeature.subTitle') + title: i18n.t('New features'), + subtitle: i18n.t('New features sub-title') } } ``` @@ -83,8 +83,8 @@ In order to add a new page you need to go along the following steps: { to: '/user/new-feature', icon: 'fancy_icon', - label: this.$t('navigation.newFeature.title'), - sublabel: this.$t('navigation.newFeature.subTitle'), + label: this.$t('New features'), + sublabel: this.$t('New features sub-title'), visible: true } ``` diff --git a/src/api/call-forward.js b/src/api/call-forward.js index 282fa718..82f4354d 100644 --- a/src/api/call-forward.js +++ b/src/api/call-forward.js @@ -501,13 +501,13 @@ export function getDaysFromRange (options) { let fromDay = options.fromDay const toDay = options.toDay + 1 const wdayMap = { - 1: i18n.t('pages.callForward.times.sunday'), - 2: i18n.t('pages.callForward.times.monday'), - 3: i18n.t('pages.callForward.times.tuesday'), - 4: i18n.t('pages.callForward.times.wednesday'), - 5: i18n.t('pages.callForward.times.thursday'), - 6: i18n.t('pages.callForward.times.friday'), - 7: i18n.t('pages.callForward.times.saturday') + 1: i18n.t('Sunday'), + 2: i18n.t('Monday'), + 3: i18n.t('Tuesday'), + 4: i18n.t('Wednesday'), + 5: i18n.t('Thursday'), + 6: i18n.t('Friday'), + 7: i18n.t('Saturday') } const days = [] while (fromDay < toDay) { diff --git a/src/api/fax.js b/src/api/fax.js index 946569b2..1ad67b85 100644 --- a/src/api/fax.js +++ b/src/api/fax.js @@ -23,7 +23,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.t('faxSettings.destinationEmailExists')) + throw Error(i18n.t('The Destination Email is already used')) } } return patchReplaceFull({ @@ -50,7 +50,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.t('faxSettings.notifyEmailExists')) + throw Error(i18n.t('The Notify Email is already used')) } } return patchReplaceFull({ diff --git a/src/api/speed-dial.js b/src/api/speed-dial.js index 47720b50..f6b1587c 100644 --- a/src/api/speed-dial.js +++ b/src/api/speed-dial.js @@ -30,7 +30,7 @@ export function getUnassignedSlots (id) { const slotOptions = [] unassignedSlots.forEach((slot) => { slotOptions.push({ - label: `${i18n.t('speedDial.slot')} ${slot}`, + label: `${i18n.t('Slot')} ${slot}`, value: slot }) }) diff --git a/src/boot/constants.js b/src/boot/constants.js index 0fe0caac..3a23a0e0 100644 --- a/src/boot/constants.js +++ b/src/boot/constants.js @@ -1,9 +1,9 @@ export default ({ Vue, app }) => { Vue.prototype.$faxQualityOptions = [ - { label: app.i18n.t('communication.quality.normal'), value: 'normal' }, - { label: app.i18n.t('communication.quality.fine'), value: 'fine' }, - { label: app.i18n.t('communication.quality.super'), value: 'super' } + { label: app.i18n.t('Normal'), value: 'normal' }, + { label: app.i18n.t('Fine'), value: 'fine' }, + { label: app.i18n.t('Super'), value: 'super' } ] Vue.prototype.$faxQualityOptionsDefault = Vue.prototype.$faxQualityOptions[0] } diff --git a/src/boot/routes.js b/src/boot/routes.js index 473c18b6..d087b24e 100644 --- a/src/boot/routes.js +++ b/src/boot/routes.js @@ -41,7 +41,7 @@ export default ({ app, router, store }) => { }) router.afterEach((to, from) => { - const mainTitle = app.i18n.t('title') + const mainTitle = app.i18n.t('CSC') let title = _.get(to, 'meta.title', '') const subTitle = _.get(to, 'meta.subtitle', '') if (mainTitle !== '') { diff --git a/src/boot/vuelidate.js b/src/boot/vuelidate.js index b3488d5f..a2e705f1 100644 --- a/src/boot/vuelidate.js +++ b/src/boot/vuelidate.js @@ -7,7 +7,7 @@ export default ({ Vue, app }) => { let message = null _.forEach(def.$params, (param, paramName) => { if (def[paramName] === false) { - message = app.i18n.t('validators.' + paramName) + message = app.i18n.t('validators.' + paramName) // TODO: does it work? we should recheck translations } }) return message diff --git a/src/components/CscChangePasswordDialog.vue b/src/components/CscChangePasswordDialog.vue index f0ea5790..9c40bc95 100644 --- a/src/components/CscChangePasswordDialog.vue +++ b/src/components/CscChangePasswordDialog.vue @@ -4,7 +4,7 @@ :value="value" :loading="loading" title-icon="vpn_key" - :title="$t('pages.login.changePassword')" + :title="$t('Change password')" class="csc-pbx-password-dialog" @input="$emit('input')" @hide="$emit('dialog-closed')" @@ -29,7 +29,7 @@ :loading="loading" @click="$refs.changePasswordForm.submit()" > - {{ $t('buttons.save') }} + {{ $t('Save') }} diff --git a/src/components/CscConfirmationDialog.vue b/src/components/CscConfirmationDialog.vue index 822bf908..de5c0c66 100644 --- a/src/components/CscConfirmationDialog.vue +++ b/src/components/CscConfirmationDialog.vue @@ -18,7 +18,7 @@ flat @click="confirm" > - {{ $t('buttons.confirm') }} + {{ $t('Confirm') }} diff --git a/src/components/CscDialog.vue b/src/components/CscDialog.vue index df2108bb..65563ef4 100644 --- a/src/components/CscDialog.vue +++ b/src/components/CscDialog.vue @@ -45,7 +45,7 @@ icon="clear" color="white" flat - :label="$t('buttons.cancel')" + :label="$t('Cancel')" @click="cancel" /> diff --git a/src/components/CscPopupMenuItemStartCall.vue b/src/components/CscPopupMenuItemStartCall.vue index 014571cb..9e102059 100644 --- a/src/components/CscPopupMenuItemStartCall.vue +++ b/src/components/CscPopupMenuItemStartCall.vue @@ -2,7 +2,7 @@ diff --git a/src/components/CscRemoveDialog.vue b/src/components/CscRemoveDialog.vue index b9e43b3b..6bc23e27 100644 --- a/src/components/CscRemoveDialog.vue +++ b/src/components/CscRemoveDialog.vue @@ -18,7 +18,7 @@ flat @click="remove" > - {{ $t('buttons.remove') }} + {{ $t('Remove') }} diff --git a/src/components/CscRetrievePasswordDialog.vue b/src/components/CscRetrievePasswordDialog.vue index 4c46c098..4c87e94d 100644 --- a/src/components/CscRetrievePasswordDialog.vue +++ b/src/components/CscRetrievePasswordDialog.vue @@ -2,7 +2,7 @@ @@ -16,7 +16,7 @@ v-model.trim="username" clearable dense - :label="$t('pages.login.username')" + :label="$t('Username')" type="text" :error="$v.username.$error" :error-message="$errorMessage($v.username)" @@ -41,7 +41,7 @@ icon="check" unelevated color="primary" - :label="$t('toasts.send')" + :label="$t('Send')" :loading="newPasswordRequesting" :disable="!username || username.length < 1 || newPasswordRequesting" @click="submit()" @@ -105,7 +105,7 @@ export default { position: 'top', color: 'negative', icon: 'error', - message: this.$t('toasts.errorPasswordReset') + message: this.$t('There was an error, please retry later') }) } finally { this.$emit('close') diff --git a/src/components/CscSendFax.vue b/src/components/CscSendFax.vue index 15bbc353..4a9e96db 100644 --- a/src/components/CscSendFax.vue +++ b/src/components/CscSendFax.vue @@ -10,13 +10,13 @@ - {{ $t('communication.sendFax') }} + {{ $t('Send Fax') }} @@ -25,13 +25,13 @@ emit-value map-options :options="$faxQualityOptions" - :label="$t('communication.label.quality')" + :label="$t('Quality')" /> @@ -78,7 +78,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -124,7 +124,7 @@ - + @@ -133,7 +133,7 @@ - + @@ -204,20 +204,20 @@ export default { !this.hasContentToSend }, pageHeaderErrorMessage () { - return this.$t('validationErrors.maxLength', { - field: this.$t('communication.label.pageHeader'), + return this.$t('{field} must have at most {maxLength} letters', { + field: this.$t('Page Header'), maxLength: this.$v.form.pageHeader.$params.maxLength.max }) }, dataErrorMessage () { if (!this.$v.form.data.required) { - return this.$t('validationErrors.fieldRequiredXor', { - fieldOne: this.$t('communication.label.content'), - fieldTwo: this.$t('communication.label.file') + return this.$t('{fieldOne} or {fieldTwo} is required', { + fieldOne: this.$t('Content'), + fieldTwo: this.$t('File') }) } else if (!this.$v.form.data.maxLength) { - return this.$t('validationErrors.maxLength', { - field: this.$t('communication.label.content'), + return this.$t('{field} must have at most {maxLength} letters', { + field: this.$t('Content'), maxLength: this.$v.form.data.$params.maxLength.max }) } else { @@ -225,9 +225,9 @@ export default { } }, fileErrorMessage () { - return this.$t('validationErrors.fieldRequiredXor', { - fieldOne: this.$t('communication.label.file'), - fieldTwo: this.$t('communication.label.content') + return this.$t('{fieldOne} or {fieldTwo} is required', { + fieldOne: this.$t('File'), + fieldTwo: this.$t('Content') }) } }, @@ -253,7 +253,7 @@ export default { sendFax () { if (this.$v.form.$error || this.destinationError) { - showGlobalError(this.$t('validationErrors.generic')) + showGlobalError(this.$t('You have invalid form input. Please check and try again.')) } else { this.$store.dispatch('communication/createFax', this.form) } diff --git a/src/components/CscTimeRange.vue b/src/components/CscTimeRange.vue index 5248af98..6d3e4d01 100644 --- a/src/components/CscTimeRange.vue +++ b/src/components/CscTimeRange.vue @@ -10,7 +10,7 @@ dark dense no-error-icon - :placeholder="$t('pages.newCallForward.dateRangeStartTime')" + :placeholder="$t('Start time')" class="q-pa-sm" @click="$refs.timeFromPopup.show()" > @@ -36,7 +36,7 @@ > @@ -54,7 +54,7 @@ dark dense no-error-icon - :placeholder="$t('pages.newCallForward.dateRangeEndTime')" + :placeholder="$t('End time')" class="q-pa-sm" @click="$refs.timeToPopup.show()" > @@ -80,7 +80,7 @@ > @@ -145,7 +145,7 @@ export default { } } else { this.timeTo = null - showGlobalError(this.$t('pages.newCallForward.officeHoursInvalidTimerange')) + showGlobalError(this.$t('Please select a valid timerange')) } } }, diff --git a/src/components/CscUserMenu.vue b/src/components/CscUserMenu.vue index c96195e8..af060dfb 100644 --- a/src/components/CscUserMenu.vue +++ b/src/components/CscUserMenu.vue @@ -15,7 +15,7 @@ - {{ $t('numbers') }} + {{ $t('Numbers') }} - {{ $t('userMenu.settings') }} + {{ $t('Settings') }} - {{ $t('userMenu.logout') }} + {{ $t('Logout') }} diff --git a/src/components/Error404.vue b/src/components/Error404.vue index 81669c06..e0c579b5 100644 --- a/src/components/Error404.vue +++ b/src/components/Error404.vue @@ -6,7 +6,7 @@ >
- {{ $t('notFound') }} + {{ $t('404 Not Found') }}
diff --git a/src/components/call-forwarding/CscCfGroupConditionMenu.vue b/src/components/call-forwarding/CscCfGroupConditionMenu.vue index 38c3b336..0bc778e1 100644 --- a/src/components/call-forwarding/CscCfGroupConditionMenu.vue +++ b/src/components/call-forwarding/CscCfGroupConditionMenu.vue @@ -1,6 +1,6 @@ diff --git a/src/components/form/CscFormSaveButton.vue b/src/components/form/CscFormSaveButton.vue index dcfd1c06..94304b8f 100644 --- a/src/components/form/CscFormSaveButton.vue +++ b/src/components/form/CscFormSaveButton.vue @@ -5,7 +5,7 @@ color="primary" @click="click" > - {{ $t('buttons.save') }} + {{ $t('Save') }} diff --git a/src/components/form/CscInputButtonReset.vue b/src/components/form/CscInputButtonReset.vue index 481bb102..ffb9d4fb 100644 --- a/src/components/form/CscInputButtonReset.vue +++ b/src/components/form/CscInputButtonReset.vue @@ -4,7 +4,7 @@ color="white" flat dense - :label="$t('buttons.reset')" + :label="$t('Reset')" :disable="$attrs.loading" v-bind="$attrs" v-on="$listeners" diff --git a/src/components/form/CscInputButtonSave.vue b/src/components/form/CscInputButtonSave.vue index 70cb2dd2..1686ae69 100644 --- a/src/components/form/CscInputButtonSave.vue +++ b/src/components/form/CscInputButtonSave.vue @@ -4,7 +4,7 @@ color="primary" flat dense - :label="$t('buttons.save')" + :label="$t('Save')" :disable="$attrs.loading" v-bind="$attrs" v-on="$listeners" diff --git a/src/components/form/CscInputFile.vue b/src/components/form/CscInputFile.vue index 61300539..c3756e53 100644 --- a/src/components/form/CscInputFile.vue +++ b/src/components/form/CscInputFile.vue @@ -20,7 +20,7 @@ text-color="dark" size="sm" unelevated - :label="$t('buttons.select')" + :label="$t('Select')" @click="$refs.fileInput.$el.click()" /> diff --git a/src/components/form/CscInputPasswordRetype.vue b/src/components/form/CscInputPasswordRetype.vue index a3cb8e59..055945a7 100644 --- a/src/components/form/CscInputPasswordRetype.vue +++ b/src/components/form/CscInputPasswordRetype.vue @@ -8,7 +8,7 @@ v-bind="$attrs" generate clearable - :label="$t('pbxConfig.typePassword')" + :label="$t('Password')" @input="inputPassword" @generated="passwordGenerated" @clear="passwordClear" @@ -28,7 +28,7 @@ ref="passwordRetype" v-model="passwordRetype" v-bind="$attrs" - :label="$t('pbxConfig.retypePassword')" + :label="$t('Password Retype')" :error="$v.passwordRetype.$error" :error-message="errorMessagePasswordRetype" clearable @@ -82,7 +82,7 @@ export default { computed: { errorMessagePasswordRetype () { if (!this.$v.passwordRetype.sameAsPassword) { - return this.$t('pbxConfig.errorPasswordNotEqual') + return this.$t('Passwords must be equal') } else { return '' } diff --git a/src/components/form/CscInputSaveable.vue b/src/components/form/CscInputSaveable.vue index c407819f..63965e60 100644 --- a/src/components/form/CscInputSaveable.vue +++ b/src/components/form/CscInputSaveable.vue @@ -33,7 +33,7 @@ color="primary" flat dense - :label="$t('buttons.undo')" + :label="$t('Undo')" :disable="$attrs.loading" @click="$emit('undo', $event)" /> @@ -43,7 +43,7 @@ color="primary" flat dense - :label="$t('buttons.save')" + :label="$t('Save')" :disable="$attrs.loading" @click="$emit('save', $event)" /> diff --git a/src/components/form/CscSoundFileUpload.vue b/src/components/form/CscSoundFileUpload.vue index 0ab675e1..a5eed369 100644 --- a/src/components/form/CscSoundFileUpload.vue +++ b/src/components/form/CscSoundFileUpload.vue @@ -33,7 +33,7 @@ color="primary" flat dense - :label="$t('buttons.select')" + :label="$t('Select')" :disable="isPlaying" @click="$refs.fileUpload.click()" /> @@ -43,7 +43,7 @@ color="negative" flat dense - :label="$t('buttons.remove')" + :label="$t('Remove')" :disable="isPlaying" @click="remove" /> @@ -53,7 +53,7 @@ color="primary" flat dense - :label="$t('buttons.reset')" + :label="$t('Reset')" :disable="isPlaying" @click="cancel" /> @@ -63,7 +63,7 @@ color="primary" flat dense - :label="$t('buttons.upload')" + :label="$t('Upload')" :disable="isPlaying" @click="upload" /> @@ -203,9 +203,9 @@ export default { }, removeLabel () { if (this.deleteTerm === 'remove') { - return this.$t('buttons.removeFile') + return this.$t('Remove file') } else { - return this.$t('buttons.resetDefaults') + return this.$t('Reset to defaults') } }, removeIcon () { diff --git a/src/components/pages/CallBlocking/CscBlockedNumber.vue b/src/components/pages/CallBlocking/CscBlockedNumber.vue index 97601d50..35dad27a 100644 --- a/src/components/pages/CallBlocking/CscBlockedNumber.vue +++ b/src/components/pages/CallBlocking/CscBlockedNumber.vue @@ -35,13 +35,13 @@ diff --git a/src/components/pages/CallBlocking/CscCallBlocking.vue b/src/components/pages/CallBlocking/CscCallBlocking.vue index eb4fce92..8fa4df54 100644 --- a/src/components/pages/CallBlocking/CscCallBlocking.vue +++ b/src/components/pages/CallBlocking/CscCallBlocking.vue @@ -8,7 +8,7 @@ > - {{ $t('callBlocking.listEmptyMessage') }} + {{ $t('No numbers found') }}
@@ -162,16 +162,16 @@ export default { ]), toggleButtonLabel () { if (!this.enabled) { - return this.$i18n.t('pages.callBlocking' + this.suffix + '.toggleEnableLabel') + return this.getTranslation('toggleEnableLabel') } else { - return this.$i18n.t('pages.callBlocking' + this.suffix + '.toggleDisableLabel') + return this.getTranslation('toggleDisableLabel') } }, toggleToastMessage () { if (this.mode) { - return this.$i18n.t('pages.callBlocking' + this.suffix + '.toggleEnabledToast') + return this.getTranslation('toggleEnabledToast') } else { - return this.$i18n.t('pages.callBlocking' + this.suffix + '.toggleDisabledToast') + return this.getTranslation('toggleDisabledToast') } }, suffix () { @@ -179,7 +179,7 @@ export default { }, removeDialogMessage () { if (this.currentRemovingIndex !== null) { - return this.$t('pages.callBlocking' + this.suffix + '.removeDialogText', { + return this.getTranslation('removeDialogText', { number: this.numbers[this.currentRemovingIndex] }) } else { @@ -229,7 +229,7 @@ export default { numberDeletionConfirm (index) { this.currentRemovingIndex = index this.$q.dialog({ - title: this.$t('pages.callBlocking' + this.suffix + '.removeDialogTitle'), + title: this.getTranslation('removeDialogTitle'), message: this.removeDialogMessage, color: 'primary', cancel: true, @@ -237,6 +237,32 @@ export default { }).onOk(data => { this.removeNumber() }) + }, + getTranslation (key, params) { + let translationsMap + switch (this.suffix) { + case 'Incoming': + translationsMap = { + toggleEnableLabel: this.$t('Only incoming calls from listed numbers are allowed'), + toggleDisableLabel: this.$t('All incoming calls from listed numbers are blocked'), + toggleEnabledToast: this.$t('All listed numbers are allowed'), + toggleDisabledToast: this.$t('All listed numbers are blocked'), + removeDialogTitle: this.$t('Remove number'), + removeDialogText: this.$t('You are about to remove the number {number}', params) + } + break + case 'Outgoing': + translationsMap = { + toggleEnableLabel: this.$t('Only outgoing calls to listed numbers are allowed'), + toggleDisableLabel: this.$t('All outgoing calls to listed numbers are blocked'), + toggleEnabledToast: this.$t('All listed numbers are allowed'), + toggleDisabledToast: this.$t('All listed numbers are blocked'), + removeDialogTitle: this.$t('Remove number'), + removeDialogText: this.$t('You are about to remove the number {number}', params) + } + break + } + return translationsMap[key] } } } diff --git a/src/components/pages/CallBlocking/CscCallBlockingAddForm.vue b/src/components/pages/CallBlocking/CscCallBlockingAddForm.vue index 45bad24e..e3c3cca5 100644 --- a/src/components/pages/CallBlocking/CscCallBlockingAddForm.vue +++ b/src/components/pages/CallBlocking/CscCallBlockingAddForm.vue @@ -5,7 +5,7 @@ > @@ -18,7 +18,7 @@ icon="clear" @mousedown.native="cancel()" > - {{ $t('buttons.cancel') }} + {{ $t('Cancel') }}
- {{ $t('buttons.save') }} + {{ $t('Save') }}
- {{ $t('pages.callBlockingIncoming.addNumberButton') }} + {{ $t('Add number') }}
@@ -90,7 +90,7 @@ export default { methods: { save () { if (this.numberError || this.saveDisabled) { - showGlobalError(this.$t('validationErrors.generic')) + showGlobalError(this.$t('You have invalid form input. Please check and try again.')) } else { this.$emit('save', this.number) } diff --git a/src/components/pages/CallForward/CscAddDestinationForm.vue b/src/components/pages/CallForward/CscAddDestinationForm.vue index 1cbdc4ec..8b2e3e78 100644 --- a/src/components/pages/CallForward/CscAddDestinationForm.vue +++ b/src/components/pages/CallForward/CscAddDestinationForm.vue @@ -6,20 +6,20 @@ dense color="primary" icon="add" - :label="$t('pages.callForward.addDestinationButton')" + :label="$t('Add destination')" > @@ -27,7 +27,7 @@
- {{ $t('buttons.cancel') }} + {{ $t('Cancel') }} - {{ $t('buttons.save') }} + {{ $t('Save') }}
@@ -154,16 +154,16 @@ export default { ]), timeoutInputError () { if (!this.$v.destinationForm.timeout.required) { - return this.$t('validationErrors.fieldRequired', { - field: this.$t('pages.callForward.timeout') + return this.$t('{field} is required', { + field: this.$t('Timeout') }) } else if (!this.$v.destinationForm.timeout.numeric) { - return this.$t('validationErrors.numeric', { - field: this.$t('pages.callForward.timeout') + return this.$t('{field} must consist of numeric characters only', { + field: this.$t('Timeout') }) } else if (!this.$v.destinationForm.timeout.minValue) { - return this.$t('validationErrors.minValueSecond', { - field: this.$t('pages.callForward.timeout'), + return this.$t('{field} must be at least {minValue} second', { + field: this.$t('Timeout'), minValue: this.$v.destinationForm.timeout.$params.minValue.min }) } else { @@ -225,7 +225,7 @@ export default { addDestination () { if (this.$v.destinationForm.timeout.$error || this.destinationError) { - showGlobalError(this.$t('validationErrors.generic')) + showGlobalError(this.$t('You have invalid form input. Please check and try again.')) } else { this.$store.dispatch('callForward/addDestination', { form: this.destinationForm, diff --git a/src/components/pages/CallForward/CscAddTimeForm.vue b/src/components/pages/CallForward/CscAddTimeForm.vue index 5c9950fa..689fded4 100644 --- a/src/components/pages/CallForward/CscAddTimeForm.vue +++ b/src/components/pages/CallForward/CscAddTimeForm.vue @@ -45,7 +45,7 @@ color="default" @click="disableForm()" > - {{ $t('buttons.cancel') }} + {{ $t('Cancel') }}
- {{ $t('buttons.save') }} + {{ $t('Save') }}
@@ -85,13 +85,13 @@ export default { data () { return { selectOptions: [ - { label: this.$t('pages.callForward.times.sunday'), value: 1 }, - { label: this.$t('pages.callForward.times.monday'), value: 2 }, - { label: this.$t('pages.callForward.times.tuesday'), value: 3 }, - { label: this.$t('pages.callForward.times.wednesday'), value: 4 }, - { label: this.$t('pages.callForward.times.thursday'), value: 5 }, - { label: this.$t('pages.callForward.times.friday'), value: 6 }, - { label: this.$t('pages.callForward.times.saturday'), value: 7 } + { label: this.$t('Sunday'), value: 1 }, + { label: this.$t('Monday'), value: 2 }, + { label: this.$t('Tuesday'), value: 3 }, + { label: this.$t('Wednesday'), value: 4 }, + { label: this.$t('Thursday'), value: 5 }, + { label: this.$t('Friday'), value: 6 }, + { label: this.$t('Saturday'), value: 7 } ], selectedWeekday: 1, timeTo: '0:00', @@ -139,7 +139,7 @@ export default { name: this.timeset }) } else { - showGlobalError(this.$t('pages.callForward.times.selectValidTime')) + showGlobalError(this.$t('Select valid time')) } } } diff --git a/src/components/pages/CallForward/CscCallForwardDestinations.vue b/src/components/pages/CallForward/CscCallForwardDestinations.vue index 68f0a8ad..baded770 100644 --- a/src/components/pages/CallForward/CscCallForwardDestinations.vue +++ b/src/components/pages/CallForward/CscCallForwardDestinations.vue @@ -2,7 +2,7 @@
diff --git a/src/components/pages/CallForward/CscCallForwardTimes.vue b/src/components/pages/CallForward/CscCallForwardTimes.vue index 56f18253..3cf5ed9b 100644 --- a/src/components/pages/CallForward/CscCallForwardTimes.vue +++ b/src/components/pages/CallForward/CscCallForwardTimes.vue @@ -31,7 +31,7 @@ class="add-time" @click="enableAddForm()" > - {{ $t('pages.callForward.times.addTimeButton') }} + {{ $t('Add Time') }}
diff --git a/src/components/pages/CallForward/CscCallForwardTimeset.vue b/src/components/pages/CallForward/CscCallForwardTimeset.vue index 1067387e..f95a9415 100644 --- a/src/components/pages/CallForward/CscCallForwardTimeset.vue +++ b/src/components/pages/CallForward/CscCallForwardTimeset.vue @@ -47,7 +47,7 @@ v-if="timesetHasDuplicate" > - {{ $t('pages.callForward.times.timesetDuplicate', { timeset: timesetName }) }} + {{ $t('More than one {timeset} timeset exists. You can resolve this by resetting the {timeset} timesets.', { timeset: timesetName }) }} diff --git a/src/components/pages/Conversations/CscConversationItem.vue b/src/components/pages/Conversations/CscConversationItem.vue index a0a72d09..31c92ae4 100644 --- a/src/components/pages/Conversations/CscConversationItem.vue +++ b/src/components/pages/Conversations/CscConversationItem.vue @@ -85,23 +85,23 @@ export default { }, blockIncomingLabel () { if (this.blockedIncoming) { - return this.$t('pages.conversations.buttons.unblockIncoming') + return this.$t('Unblock Incoming') } else { - return this.$t('pages.conversations.buttons.blockIncoming') + return this.$t('Block Incoming') } }, blockOutgoingLabel () { if (this.blockedOutgoing) { - return this.$t('pages.conversations.buttons.unblockOutgoing') + return this.$t('Unblock Outgoing') } else { - return this.$t('pages.conversations.buttons.blockOutgoing') + return this.$t('Block Outgoing') } }, blockBothLabel () { if (this.blockedBoth) { - return this.$t('pages.conversations.buttons.unblockBoth') + return this.$t('Unblock Incoming/Outgoing') } else if (this.unblockedBoth) { - return this.$t('pages.conversations.buttons.blockBoth') + return this.$t('Block Incoming/Outgoing') } else { return '' } diff --git a/src/components/pages/Conversations/CscFaxItem.vue b/src/components/pages/Conversations/CscFaxItem.vue index 069d2a54..d0ff2dc3 100644 --- a/src/components/pages/Conversations/CscFaxItem.vue +++ b/src/components/pages/Conversations/CscFaxItem.vue @@ -13,7 +13,7 @@ - {{ $t('pages.conversations.fax') }} + {{ $t('Fax') }} {{ direction }} {{ fax.caller | numberFormat }} @@ -32,13 +32,13 @@ v-else-if="fax.pages === 1" caption > - {{ fax.pages }} {{ $t('pages.conversations.page') }} + {{ fax.pages }} {{ $t('page') }} - {{ fax.pages }} {{ $t('pages.conversations.pages') }} + {{ fax.pages }} {{ $t('pages') }} - {{ $t('pages.conversations.voicemail') }} + {{ $t('Voicemail') }} {{ direction }} {{ voiceMail.caller | destinationFormat }} @@ -25,9 +25,9 @@ - {{ $t('pages.conversations.duration') }} + {{ $t('Duration') }} {{ voiceMail.duration }} - {{ $t('pages.conversations.seconds') }} + {{ $t('seconds') }} - {{ $t('faxSettings.destinationItemTitle', {destination: destination.destination, filetype: destination.filetype}) }} + {{ $t('<{destination}> as {filetype}', {destination: destination.destination, filetype: destination.filetype}) }} - {{ $t('buttons.remove') }} + {{ $t('Remove') }} @@ -36,7 +36,7 @@ icon-color="negative" @click="deleteDevice" > - {{ $t('buttons.remove') }} + {{ $t('Remove') }}