From 7d5dc776c1e2437f0034ff0e4c5da35d04345da3 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Thu, 23 Jul 2020 16:07:08 +0200 Subject: [PATCH] replaced most of the translate.instant for $t --- front/core/components/autocomplete/index.js | 2 +- front/core/components/drop-down/index.js | 2 +- front/core/components/searchbar/searchbar.js | 2 +- modules/claim/front/detail/index.js | 10 +++++----- modules/client/front/address/index/index.js | 2 +- modules/client/front/contact/index.js | 2 +- .../client/front/credit-insurance/create/index.js | 2 +- modules/client/front/dms/create/index.js | 6 +++--- modules/client/front/dms/edit/index.js | 4 ++-- modules/client/front/fiscal-data/index.js | 2 +- modules/client/front/postcode/index.js | 4 ++-- modules/client/front/sample/create/index.js | 8 ++++---- modules/client/front/sms/index.js | 4 ++-- modules/client/front/web-access/index.js | 4 ++-- modules/order/front/create/card.js | 2 +- modules/route/front/tickets/index.js | 12 ++++++------ modules/ticket/front/basic-data/step-one/index.js | 8 ++++---- modules/ticket/front/basic-data/step-two/index.js | 4 ++-- modules/ticket/front/create/card.js | 2 +- modules/ticket/front/descriptor/addStowaway.js | 2 +- modules/ticket/front/dms/create/index.js | 6 +++--- modules/ticket/front/dms/edit/index.js | 4 ++-- modules/ticket/front/index/index.html | 2 +- modules/ticket/front/sale/index.js | 2 +- modules/ticket/front/sms/index.js | 4 ++-- modules/ticket/front/summary/index.html | 2 +- modules/ticket/front/summary/index.js | 2 +- modules/ticket/front/tracking/edit/index.js | 2 +- modules/ticket/front/tracking/edit/index.spec.js | 2 +- modules/travel/front/thermograph/create/index.js | 6 +++--- modules/travel/front/thermograph/edit/index.js | 4 ++-- modules/travel/front/thermograph/index/index.js | 2 +- modules/worker/front/department/index.js | 2 +- modules/worker/front/dms/create/index.js | 6 +++--- modules/worker/front/dms/edit/index.js | 4 ++-- 35 files changed, 67 insertions(+), 67 deletions(-) diff --git a/front/core/components/autocomplete/index.js b/front/core/components/autocomplete/index.js index 38c85db57..30e984fc6 100755 --- a/front/core/components/autocomplete/index.js +++ b/front/core/components/autocomplete/index.js @@ -192,7 +192,7 @@ export default class Autocomplete extends Field { if (this.translateFields) { if (this.translateFields.indexOf(this.showField) > -1) - this.input.value = this.$translate.instant(display); + this.input.value = this.$t(display); } } diff --git a/front/core/components/drop-down/index.js b/front/core/components/drop-down/index.js index dfdfbe18d..fd5792da6 100644 --- a/front/core/components/drop-down/index.js +++ b/front/core/components/drop-down/index.js @@ -276,7 +276,7 @@ export default class DropDown extends Popover { if (this.translateFields) { option = Object.assign({}, option); for (let field of this.translateFields) - option[field] = this.$translate.instant(option[field]); + option[field] = this.$t(option[field]); } let li = this.document.createElement('li'); diff --git a/front/core/components/searchbar/searchbar.js b/front/core/components/searchbar/searchbar.js index 073b77f6e..9720916ee 100644 --- a/front/core/components/searchbar/searchbar.js +++ b/front/core/components/searchbar/searchbar.js @@ -36,7 +36,7 @@ export default class Searchbar extends Component { } this.searchState = `${this.baseState}.index`; - this.placeholder = this.$translate.instant('Search by', { + this.placeholder = this.$t('Search by', { module: this.baseState }); } diff --git a/modules/claim/front/detail/index.js b/modules/claim/front/detail/index.js index c97f3bd47..6137c8e4e 100644 --- a/modules/claim/front/detail/index.js +++ b/modules/claim/front/detail/index.js @@ -75,7 +75,7 @@ class Controller extends Section { this.$http.post(query, saleToAdd).then(() => { this.$.addSales.hide(); this.$.model.refresh(); - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); if (this.aclService.hasAny(['salesAssistant'])) this.$state.go('claim.card.development'); @@ -90,7 +90,7 @@ class Controller extends Section { deleteClaimedSale() { let query = `ClaimBeginnings/${this.sale.id}`; this.$http.delete(query).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.model.remove(this.sale); this.calculateTotals(); }); @@ -100,7 +100,7 @@ class Controller extends Section { let params = {id: id, quantity: claimedQuantity}; let query = `ClaimBeginnings/`; this.$http.patch(query, params).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.calculateTotals(); }); } @@ -134,7 +134,7 @@ class Controller extends Section { showEditPopover(event, saleClaimed) { if (this.isEditable) { if (!this.aclService.hasAny(['salesAssistant'])) - return this.vnApp.showError(this.$translate.instant('Insuficient permisos')); + return this.vnApp.showError(this.$t('Insuficient permisos')); this.saleClaimed = saleClaimed; this.$.editPopover.parent = event.target; @@ -175,7 +175,7 @@ class Controller extends Section { this.calculateTotals(); this.clearDiscount(); - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); }).catch(err => { this.vnApp.showError(err.message); }); diff --git a/modules/client/front/address/index/index.js b/modules/client/front/address/index/index.js index 6a9d7507b..a4e13818d 100644 --- a/modules/client/front/address/index/index.js +++ b/modules/client/front/address/index/index.js @@ -50,7 +50,7 @@ class Controller extends Section { if (res.data) { this.client.defaultAddressFk = res.data.defaultAddressFk; this.sortAddresses(); - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); } }); } diff --git a/modules/client/front/contact/index.js b/modules/client/front/contact/index.js index 4f29ddb8c..98522bfe2 100644 --- a/modules/client/front/contact/index.js +++ b/modules/client/front/contact/index.js @@ -5,7 +5,7 @@ class Controller extends Section { add() { this.$.model.insert({ clientFk: this.client.id, - name: this.$translate.instant('Phone'), + name: this.$t('Phone'), phone: null }); } diff --git a/modules/client/front/credit-insurance/create/index.js b/modules/client/front/credit-insurance/create/index.js index 5ea2a8039..4c838db73 100644 --- a/modules/client/front/credit-insurance/create/index.js +++ b/modules/client/front/credit-insurance/create/index.js @@ -11,7 +11,7 @@ class Controller extends Section { onSubmit() { if (this.$.form.$invalid) - return this.vnApp.showError(this.$translate.instant('Some fields are invalid')); + return this.vnApp.showError(this.$t('Some fields are invalid')); let query = `creditClassifications/createWithInsurance`; let data = this.creditClassification; diff --git a/modules/client/front/dms/create/index.js b/modules/client/front/dms/create/index.js index 0422ab6a6..b128cb3c2 100644 --- a/modules/client/front/dms/create/index.js +++ b/modules/client/front/dms/create/index.js @@ -33,7 +33,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -51,7 +51,7 @@ class Controller extends Section { warehouseId: warehouseId, companyId: companyId, dmsTypeId: dmsType.id, - description: this.$translate.instant('ClientFileDescription', { + description: this.$t('ClientFileDescription', { dmsTypeName: dmsType.name, clientId: this.client.id, clientName: this.client.name @@ -83,7 +83,7 @@ class Controller extends Section { }; this.$http(options).then(res => { if (res) { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('client.card.dms.index'); } diff --git a/modules/client/front/dms/edit/index.js b/modules/client/front/dms/edit/index.js index dedd67e3f..f154f6757 100644 --- a/modules/client/front/dms/edit/index.js +++ b/modules/client/front/dms/edit/index.js @@ -24,7 +24,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -67,7 +67,7 @@ class Controller extends Section { }; this.$http(options).then(res => { if (res) { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('client.card.dms.index'); } diff --git a/modules/client/front/fiscal-data/index.js b/modules/client/front/fiscal-data/index.js index 92e27e54f..dd23e5d2d 100644 --- a/modules/client/front/fiscal-data/index.js +++ b/modules/client/front/fiscal-data/index.js @@ -65,7 +65,7 @@ export default class Controller extends Section { onAcceptEt() { const query = `Clients/${this.client.id}/addressesPropagateRe`; return this.$http.patch(query, {isEqualizated: this.client.isEqualizated}).then( - () => this.vnApp.showMessage(this.$translate.instant('Equivalent tax spreaded')) + () => this.vnApp.showMessage(this.$t('Equivalent tax spreaded')) ); } diff --git a/modules/client/front/postcode/index.js b/modules/client/front/postcode/index.js index c05ea0518..29c1d5b17 100644 --- a/modules/client/front/postcode/index.js +++ b/modules/client/front/postcode/index.js @@ -35,11 +35,11 @@ class Controller extends Component { throw new Error(`The town can't be empty`); this.$http.patch(`postcodes`, this.data).then(res => { - this.vnApp.showMessage(this.$translate.instant('The postcode has been saved')); + this.vnApp.showMessage(this.$t('The postcode has been saved')); this.emit('response', {$response: res.data}); }); } catch (e) { - this.vnApp.showError(this.$translate.instant(e.message)); + this.vnApp.showError(this.$t(e.message)); return false; } return true; diff --git a/modules/client/front/sample/create/index.js b/modules/client/front/sample/create/index.js index d1dfd3ff5..ea1646a87 100644 --- a/modules/client/front/sample/create/index.js +++ b/modules/client/front/sample/create/index.js @@ -53,7 +53,7 @@ class Controller extends Section { sendSample() { this.send(false, () => { - this.vnApp.showSuccess(this.$translate.instant('Notification sent!')); + this.vnApp.showSuccess(this.$t('Notification sent!')); this.$state.go('client.card.sample.index'); }); } @@ -66,13 +66,13 @@ class Controller extends Section { }; if (!params.recipient) - return this.vnApp.showError(this.$translate.instant('Email cannot be blank')); + return this.vnApp.showError(this.$t('Email cannot be blank')); if (!sampleType) - return this.vnApp.showError(this.$translate.instant('Choose a sample')); + return this.vnApp.showError(this.$t('Choose a sample')); if (sampleType.hasCompany && !this.clientSample.companyFk) - return this.vnApp.showError(this.$translate.instant('Choose a company')); + return this.vnApp.showError(this.$t('Choose a company')); if (sampleType.hasCompany) params.companyId = this.clientSample.companyFk; diff --git a/modules/client/front/sms/index.js b/modules/client/front/sms/index.js index 3dfdda8a3..ef8a1cd34 100644 --- a/modules/client/front/sms/index.js +++ b/modules/client/front/sms/index.js @@ -27,12 +27,12 @@ class Controller extends Section { throw new Error(`The message it's too long`); this.$http.post(`Clients/${this.$params.id}/sendSms`, this.sms).then(res => { - this.vnApp.showMessage(this.$translate.instant('SMS sent!')); + this.vnApp.showMessage(this.$t('SMS sent!')); if (res.data) this.emit('send', {response: res.data}); }); } catch (e) { - this.vnApp.showError(this.$translate.instant(e.message)); + this.vnApp.showError(this.$t(e.message)); return false; } } diff --git a/modules/client/front/web-access/index.js b/modules/client/front/web-access/index.js index 3f7f46f04..a47673f95 100644 --- a/modules/client/front/web-access/index.js +++ b/modules/client/front/web-access/index.js @@ -50,10 +50,10 @@ export default class Controller extends Section { }; this.$http.patch(`Accounts/${this.client.id}`, account).then(res => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); }); } catch (e) { - this.vnApp.showError(this.$translate.instant(e.message)); + this.vnApp.showError(this.$t(e.message)); return false; } diff --git a/modules/order/front/create/card.js b/modules/order/front/create/card.js index 158ad9a10..2b7323ee9 100644 --- a/modules/order/front/create/card.js +++ b/modules/order/front/create/card.js @@ -99,7 +99,7 @@ class Controller extends Component { agencyModeId: this.order.agencyModeFk }; this.$http.post(`Orders/new`, params).then(res => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$state.go('order.card.catalog', {id: res.data}); }); } diff --git a/modules/route/front/tickets/index.js b/modules/route/front/tickets/index.js index e7c6cb7b1..2c40c56a3 100644 --- a/modules/route/front/tickets/index.js +++ b/modules/route/front/tickets/index.js @@ -59,7 +59,7 @@ class Controller extends Section { let params = {priority: priority}; let query = `Tickets/${id}/`; this.$http.patch(query, params).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.model.refresh(); }); } @@ -106,7 +106,7 @@ class Controller extends Section { let params = {routeFk: null}; let query = `Tickets/${this.selectedTicket}/`; this.$http.patch(query, params).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Ticket removed from route')); + this.vnApp.showSuccess(this.$t('Ticket removed from route')); this.updateVolume(); }); } @@ -123,7 +123,7 @@ class Controller extends Section { guessPriority() { let query = `Routes/${this.$params.id}/guessPriority/`; this.$http.get(query).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Order changed')); + this.vnApp.showSuccess(this.$t('Order changed')); this.$.model.refresh(); }); } @@ -159,7 +159,7 @@ class Controller extends Section { if (matches && matches.length) this.insert(matches[1]); else - this.vnApp.showError(this.$translate.instant('Ticket not found')); + this.vnApp.showError(this.$t('Ticket not found')); } if (!isNaN(ticketId)) @@ -169,12 +169,12 @@ class Controller extends Section { insert(id) { const params = {routeFk: this.route.id}; this.$http.patch(`Tickets/${id}`, params).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.model.refresh(); this.card.reload(); }).catch(error => { if (error.status == 404) - return this.vnApp.showError(this.$translate.instant('Ticket not found')); + return this.vnApp.showError(this.$t('Ticket not found')); throw error; }); } diff --git a/modules/ticket/front/basic-data/step-one/index.js b/modules/ticket/front/basic-data/step-one/index.js index 6cfa51a1f..a7a5f10b7 100644 --- a/modules/ticket/front/basic-data/step-one/index.js +++ b/modules/ticket/front/basic-data/step-one/index.js @@ -173,7 +173,7 @@ class Controller extends Component { async onStepChange() { if (this.isFormInvalid()) { return this.vnApp.showError( - this.$translate.instant('Some fields are invalid') + this.$t('Some fields are invalid') ); } @@ -193,7 +193,7 @@ class Controller extends Component { return true; }, err => { this.vnApp.showError( - this.$translate.instant(err.data.error.message) + this.$t(err.data.error.message) ); }); } @@ -211,7 +211,7 @@ class Controller extends Component { this.ticket.shipped = params.shipped; } else { return this.vnApp.showError( - this.$translate.instant(`No delivery zone available for this landing date`) + this.$t(`No delivery zone available for this landing date`) ); } }); @@ -230,7 +230,7 @@ class Controller extends Component { this.ticket.shipped = res.data.shipped; } else { return this.vnApp.showError( - this.$translate.instant(`No delivery zone available for this landing date`) + this.$t(`No delivery zone available for this landing date`) ); } }); diff --git a/modules/ticket/front/basic-data/step-two/index.js b/modules/ticket/front/basic-data/step-two/index.js index 00556350b..f99dbb4fb 100644 --- a/modules/ticket/front/basic-data/step-two/index.js +++ b/modules/ticket/front/basic-data/step-two/index.js @@ -63,7 +63,7 @@ class Controller extends Component { onSubmit() { if (!this.ticket.option) { return this.vnApp.showError( - this.$translate.instant('Choose an option') + this.$t('Choose an option') ); } @@ -83,7 +83,7 @@ class Controller extends Component { this.$http.post(query, params).then(res => { this.vnApp.showMessage( - this.$translate.instant(`The ticket has been unrouted`) + this.$t(`The ticket has been unrouted`) ); this.card.reload(); this.$state.go('ticket.card.summary', {id: this.$params.id}); diff --git a/modules/ticket/front/create/card.js b/modules/ticket/front/create/card.js index 01c5da4c9..289181a48 100644 --- a/modules/ticket/front/create/card.js +++ b/modules/ticket/front/create/card.js @@ -120,7 +120,7 @@ class Controller extends Component { warehouseId: this.ticket.warehouseFk, }; this.$http.post(`Tickets/new`, params).then(res => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$state.go('ticket.card.summary', {id: res.data.id}); }); } diff --git a/modules/ticket/front/descriptor/addStowaway.js b/modules/ticket/front/descriptor/addStowaway.js index 4497fef82..e30849028 100644 --- a/modules/ticket/front/descriptor/addStowaway.js +++ b/modules/ticket/front/descriptor/addStowaway.js @@ -8,7 +8,7 @@ class Controller extends Component { this.$http.post(`Stowaways/`, params) .then(() => this.cardReload()) .then(() => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.dialog.hide(); }); } diff --git a/modules/ticket/front/dms/create/index.js b/modules/ticket/front/dms/create/index.js index e745d98b8..e8d278f1b 100644 --- a/modules/ticket/front/dms/create/index.js +++ b/modules/ticket/front/dms/create/index.js @@ -32,7 +32,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -49,7 +49,7 @@ class Controller extends Section { warehouseId: warehouseId, companyId: this.ticket.companyFk, dmsTypeId: dmsTypeId, - description: this.$translate.instant('FileDescription', { + description: this.$t('FileDescription', { ticketId: this.ticket.id, clientId: this.ticket.client.id, clientName: this.ticket.client.name @@ -81,7 +81,7 @@ class Controller extends Section { }; this.$http(options).then(res => { if (res) { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('ticket.card.dms.index'); } diff --git a/modules/ticket/front/dms/edit/index.js b/modules/ticket/front/dms/edit/index.js index 44e3890f8..c578b899a 100644 --- a/modules/ticket/front/dms/edit/index.js +++ b/modules/ticket/front/dms/edit/index.js @@ -23,7 +23,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -66,7 +66,7 @@ class Controller extends Section { }; this.$http(options).then(res => { if (res) { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('ticket.card.dms.index'); } diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index abd772229..6f3079a29 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -61,7 +61,7 @@ diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index bd3fa4813..40ac22d19 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -281,7 +281,7 @@ class Controller extends Section { const params = {salesIds: saleIds, newDiscount: this.edit.discount}; const query = `Tickets/${this.$params.id}/updateDiscount`; this.$http.post(query, params).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); for (let sale of sales) sale.discount = this.edit.discount; diff --git a/modules/ticket/front/sms/index.js b/modules/ticket/front/sms/index.js index 56959e3ee..c7fe42740 100644 --- a/modules/ticket/front/sms/index.js +++ b/modules/ticket/front/sms/index.js @@ -27,12 +27,12 @@ class Controller extends Component { throw new Error(`The message it's too long`); this.$http.post(`Tickets/${this.$params.id}/sendSms`, this.sms).then(res => { - this.vnApp.showMessage(this.$translate.instant('SMS sent!')); + this.vnApp.showMessage(this.$t('SMS sent!')); if (res.data) this.emit('send', {response: res.data}); }); } catch (e) { - this.vnApp.showError(this.$translate.instant(e.message)); + this.vnApp.showError(this.$t(e.message)); return false; } } diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 8b73c9c48..7b0e9d06d 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -108,7 +108,7 @@ + vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}"> { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); if (this.card) this.card.reload(); else diff --git a/modules/ticket/front/tracking/edit/index.js b/modules/ticket/front/tracking/edit/index.js index f2de08389..11f8fda22 100644 --- a/modules/ticket/front/tracking/edit/index.js +++ b/modules/ticket/front/tracking/edit/index.js @@ -56,7 +56,7 @@ class Controller extends Section { this.$http.post(`TicketTrackings/changeState`, this.params).then(() => { this.$.watcher.updateOriginalData(); this.card.reload(); - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$state.go('ticket.card.tracking.index'); }); } diff --git a/modules/ticket/front/tracking/edit/index.spec.js b/modules/ticket/front/tracking/edit/index.spec.js index cf8036814..0d011052e 100644 --- a/modules/ticket/front/tracking/edit/index.spec.js +++ b/modules/ticket/front/tracking/edit/index.spec.js @@ -67,7 +67,7 @@ describe('Ticket', () => { expect(controller.card.reload).toHaveBeenCalledWith(); expect(controller.$.watcher.updateOriginalData).toHaveBeenCalledWith(); - expect(controller.vnApp.showSuccess).toHaveBeenCalledWith(controller.$translate.instant('Data saved!')); + expect(controller.vnApp.showSuccess).toHaveBeenCalledWith(controller.$t('Data saved!')); expect(controller.$state.go).toHaveBeenCalledWith('ticket.card.tracking.index'); }); }); diff --git a/modules/travel/front/thermograph/create/index.js b/modules/travel/front/thermograph/create/index.js index d398febf1..7fd5699f0 100644 --- a/modules/travel/front/thermograph/create/index.js +++ b/modules/travel/front/thermograph/create/index.js @@ -28,7 +28,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -46,7 +46,7 @@ class Controller extends Section { warehouseId: warehouseId, companyId: companyId, dmsTypeId: dmsTypeId, - description: this.$translate.instant('FileDescription', { + description: this.$t('FileDescription', { travelId: this.travel.id }).toUpperCase() }; @@ -97,7 +97,7 @@ class Controller extends Section { data: this.dms.files }; this.$http(options).then(res => { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('travel.card.thermograph.index'); }); diff --git a/modules/travel/front/thermograph/edit/index.js b/modules/travel/front/thermograph/edit/index.js index 90e0cc7b1..422f6a572 100644 --- a/modules/travel/front/thermograph/edit/index.js +++ b/modules/travel/front/thermograph/edit/index.js @@ -24,7 +24,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -71,7 +71,7 @@ class Controller extends Section { }; this.$http(options).then(res => { if (res) { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('travel.card.thermograph.index'); } diff --git a/modules/travel/front/thermograph/index/index.js b/modules/travel/front/thermograph/index/index.js index 55c1720c3..992f448ad 100644 --- a/modules/travel/front/thermograph/index/index.js +++ b/modules/travel/front/thermograph/index/index.js @@ -26,7 +26,7 @@ class Controller extends Section { const thermographId = data[this.thermographIndex].id; const query = `Travels/deleteThermograph?id=${thermographId}`; this.$http.delete(query).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Thermograph deleted')); + this.vnApp.showSuccess(this.$t('Thermograph deleted')); this.$.model.remove(this.thermographIndex); this.thermographIndex = null; }); diff --git a/modules/worker/front/department/index.js b/modules/worker/front/department/index.js index 35dc650f6..f2758f084 100644 --- a/modules/worker/front/department/index.js +++ b/modules/worker/front/department/index.js @@ -58,7 +58,7 @@ class Controller extends Section { this.$.treeview.create(item); }); } catch (e) { - this.vnApp.showError(this.$translate.instant(e.message)); + this.vnApp.showError(this.$t(e.message)); return false; } } diff --git a/modules/worker/front/dms/create/index.js b/modules/worker/front/dms/create/index.js index 79d7c5fdd..0a7fb00c8 100644 --- a/modules/worker/front/dms/create/index.js +++ b/modules/worker/front/dms/create/index.js @@ -33,7 +33,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -51,7 +51,7 @@ class Controller extends Section { warehouseId: warehouseId, companyId: companyId, dmsTypeId: dmsType.id, - description: this.$translate.instant('WorkerFileDescription', { + description: this.$t('WorkerFileDescription', { dmsTypeName: dmsType.name, workerId: this.worker.id, workerName: this.worker.name @@ -83,7 +83,7 @@ class Controller extends Section { }; this.$http(options).then(res => { if (res) { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('worker.card.dms.index'); } diff --git a/modules/worker/front/dms/edit/index.js b/modules/worker/front/dms/edit/index.js index ac0104fa1..ec233e973 100644 --- a/modules/worker/front/dms/edit/index.js +++ b/modules/worker/front/dms/edit/index.js @@ -24,7 +24,7 @@ class Controller extends Section { } get contentTypesInfo() { - return this.$translate.instant('ContentTypesInfo', { + return this.$t('ContentTypesInfo', { allowedContentTypes: this.allowedContentTypes }); } @@ -67,7 +67,7 @@ class Controller extends Section { }; this.$http(options).then(res => { if (res) { - this.vnApp.showSuccess(this.$translate.instant('Data saved!')); + this.vnApp.showSuccess(this.$t('Data saved!')); this.$.watcher.updateOriginalData(); this.$state.go('worker.card.dms.index'); }