From 1538f0cc1fcac87dc3e60ae14547e7c9a7f2a0c6 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 21 Mar 2024 16:14:34 +0530 Subject: [PATCH 1/4] Removed: the use of i18n from package.json file(#280) --- package-lock.json | 714 +--------------------------------------------- package.json | 5 +- vue.config.js | 8 - 3 files changed, 3 insertions(+), 724 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17e5c127..2ec0298b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,14 +25,12 @@ "mitt": "^2.1.0", "register-service-worker": "^1.7.1", "vue": "^3.2.26", - "vue-i18n": "~9.1.6", "vue-router": "^4.0.12", "vuex": "^4.0.0", "vuex-persistedstate": "^4.0.0-beta.3" }, "devDependencies": { "@capacitor/cli": "2.4.6", - "@intlify/vue-i18n-loader": "^2.0.0-rc.3", "@types/luxon": "^3.2.0", "@typescript-eslint/eslint-plugin": "~5.26.0", "@typescript-eslint/parser": "~5.26.0", @@ -49,8 +47,7 @@ "cypress": "^8.3.0", "eslint": "^7.32.0", "eslint-plugin-vue": "^8.0.3", - "typescript": "~4.7.4", - "vue-cli-plugin-i18n": "^1.0.1" + "typescript": "~4.7.4" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -2920,39 +2917,6 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "node_modules/@intlify/bundle-utils": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@intlify/bundle-utils/-/bundle-utils-0.1.0.tgz", - "integrity": "sha512-v0aeQmjNWppSLpPcLh3E1JiQg8bQFY9uD4ZuZssGq2elXsqB3JDH0TZfhO8Y83x1Ejk0qxq5hv015mYS2qzfZQ==", - "dev": true, - "dependencies": { - "@intlify/core": "^9.1.6", - "@intlify/message-compiler": "^9.1.6", - "@intlify/shared": "^9.1.6", - "jsonc-eslint-parser": "^1.0.1", - "source-map": "^0.6.1", - "yaml-eslint-parser": "^0.3.2" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/@intlify/core": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/@intlify/core/-/core-9.8.0.tgz", - "integrity": "sha512-xd+3cxvMuasZh3b+cxsB98ZAC2SPfbSTuK8q0nJg2NfOuAcj62FKBkFG72lsvGz5MzppTlOQuLkacrCvltA8sA==", - "dev": true, - "dependencies": { - "@intlify/core-base": "9.8.0", - "@intlify/shared": "9.8.0" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, "node_modules/@intlify/core-base": { "version": "9.8.0", "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.8.0.tgz", @@ -2968,25 +2932,6 @@ "url": "https://github.com/sponsors/kazupon" } }, - "node_modules/@intlify/devtools-if": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/devtools-if/-/devtools-if-9.1.10.tgz", - "integrity": "sha512-SHaKoYu6sog3+Q8js1y3oXLywuogbH1sKuc7NSYkN3GElvXSBaMoCzW+we0ZSFqj/6c7vTNLg9nQ6rxhKqYwnQ==", - "dependencies": { - "@intlify/shared": "9.1.10" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@intlify/devtools-if/node_modules/@intlify/shared": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.1.10.tgz", - "integrity": "sha512-Om54xJeo1Vw+K1+wHYyXngE8cAbrxZHpWjYzMR9wCkqbhGtRV5VLhVc214Ze2YatPrWlS2WSMOWXR8JktX/IgA==", - "engines": { - "node": ">= 10" - } - }, "node_modules/@intlify/message-compiler": { "version": "9.8.0", "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.8.0.tgz", @@ -3002,48 +2947,6 @@ "url": "https://github.com/sponsors/kazupon" } }, - "node_modules/@intlify/message-resolver": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/message-resolver/-/message-resolver-9.1.10.tgz", - "integrity": "sha512-5YixMG/M05m0cn9+gOzd4EZQTFRUu8RGhzxJbR1DWN21x/Z3bJ8QpDYj6hC4FwBj5uKsRfKpJQ3Xqg98KWoA+w==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/@intlify/runtime": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/runtime/-/runtime-9.1.10.tgz", - "integrity": "sha512-7QsuByNzpe3Gfmhwq6hzgXcMPpxz8Zxb/XFI6s9lQdPLPe5Lgw4U1ovRPZTOs6Y2hwitR3j/HD8BJNGWpJnOFA==", - "dependencies": { - "@intlify/message-compiler": "9.1.10", - "@intlify/message-resolver": "9.1.10", - "@intlify/shared": "9.1.10" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@intlify/runtime/node_modules/@intlify/message-compiler": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.1.10.tgz", - "integrity": "sha512-+JiJpXff/XTb0EadYwdxOyRTB0hXNd4n1HaJ/a4yuV960uRmPXaklJsedW0LNdcptd/hYUZtCkI7Lc9J5C1gxg==", - "dependencies": { - "@intlify/message-resolver": "9.1.10", - "@intlify/shared": "9.1.10", - "source-map": "0.6.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@intlify/runtime/node_modules/@intlify/shared": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.1.10.tgz", - "integrity": "sha512-Om54xJeo1Vw+K1+wHYyXngE8cAbrxZHpWjYzMR9wCkqbhGtRV5VLhVc214Ze2YatPrWlS2WSMOWXR8JktX/IgA==", - "engines": { - "node": ">= 10" - } - }, "node_modules/@intlify/shared": { "version": "9.8.0", "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.8.0.tgz", @@ -3055,44 +2958,6 @@ "url": "https://github.com/sponsors/kazupon" } }, - "node_modules/@intlify/vue-devtools": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/vue-devtools/-/vue-devtools-9.1.10.tgz", - "integrity": "sha512-5l3qYARVbkWAkagLu1XbDUWRJSL8br1Dj60wgMaKB0+HswVsrR6LloYZTg7ozyvM621V6+zsmwzbQxbVQyrytQ==", - "dependencies": { - "@intlify/message-resolver": "9.1.10", - "@intlify/runtime": "9.1.10", - "@intlify/shared": "9.1.10" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@intlify/vue-devtools/node_modules/@intlify/shared": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.1.10.tgz", - "integrity": "sha512-Om54xJeo1Vw+K1+wHYyXngE8cAbrxZHpWjYzMR9wCkqbhGtRV5VLhVc214Ze2YatPrWlS2WSMOWXR8JktX/IgA==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/@intlify/vue-i18n-loader": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@intlify/vue-i18n-loader/-/vue-i18n-loader-2.1.2.tgz", - "integrity": "sha512-xGqjq9unsm6WFqcM3n8hQHE2f6yKYc8cT14PqNEBmiuR0v3PP0VqZcvKXHs9JL2BRPA8JulNugpZwuF3rob2cQ==", - "dev": true, - "dependencies": { - "@intlify/bundle-utils": "^0.1.0", - "@intlify/shared": "^9.1.6", - "loader-utils": "^2.0.0" - }, - "engines": { - "node": ">= 12" - }, - "peerDependencies": { - "vue": "^3.0.0" - } - }, "node_modules/@ionic/core": { "version": "6.7.5", "resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.7.5.tgz", @@ -6594,16 +6459,6 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -7514,15 +7369,6 @@ } } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -7824,25 +7670,6 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, - "node_modules/dot-object": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-1.9.0.tgz", - "integrity": "sha512-7MPN6y7XhAO4vM4eguj5+5HNKLjJYfkVG1ZR1Aput4Q4TR6SYeSjhpVQ77IzJHoSHffKbDxBC+48aCiiRurDPw==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "glob": "^7.1.4" - }, - "bin": { - "dot-object": "bin/dot-object" - } - }, - "node_modules/dot-object/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "node_modules/dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", @@ -8728,15 +8555,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/espree": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", @@ -11031,15 +10849,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -11429,81 +11238,6 @@ "node": ">=6" } }, - "node_modules/jsonc-eslint-parser": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsonc-eslint-parser/-/jsonc-eslint-parser-1.4.1.tgz", - "integrity": "sha512-hXBrvsR1rdjmB2kQmUjf1rEIa+TqHBGMge8pwi++C+Si1ad7EjZrJcpgwym+QGK/pqTx+K7keFAtLlVNdLRJOg==", - "dev": true, - "dependencies": { - "acorn": "^7.4.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^1.3.0", - "espree": "^6.0.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/jsonc-eslint-parser/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/jsonc-eslint-parser/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/jsonc-eslint-parser/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/jsonc-eslint-parser/node_modules/espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", - "dev": true, - "dependencies": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/jsonc-eslint-parser/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -14367,12 +14101,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -14833,12 +14561,6 @@ "node": ">= 0.8.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, "node_modules/set-function-length": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", @@ -15031,6 +14753,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -16396,58 +16119,6 @@ } } }, - "node_modules/vue-cli-plugin-i18n": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-1.0.1.tgz", - "integrity": "sha512-sLo6YzudaWgn5dOMvrKixE5bb/onYGxcxm+0YexqoOx0QtR+7hZ/P5WPFBMM9v/2i1ec2YYe2PvKTBel7KE+tA==", - "dev": true, - "dependencies": { - "debug": "^4.1.0", - "deepmerge": "^4.2.0", - "dotenv": "^8.2.0", - "flat": "^5.0.0", - "rimraf": "^3.0.0", - "vue": "^2.6.11", - "vue-i18n": "^8.17.0", - "vue-i18n-extract": "1.0.2" - } - }, - "node_modules/vue-cli-plugin-i18n/node_modules/@vue/compiler-sfc": { - "version": "2.7.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.15.tgz", - "integrity": "sha512-FCvIEevPmgCgqFBH7wD+3B97y7u7oj/Wr69zADBf403Tui377bThTjBvekaZvlRr4IwUAu3M6hYZeULZFJbdYg==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.18.4", - "postcss": "^8.4.14", - "source-map": "^0.6.1" - } - }, - "node_modules/vue-cli-plugin-i18n/node_modules/dotenv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", - "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/vue-cli-plugin-i18n/node_modules/vue": { - "version": "2.7.15", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.15.tgz", - "integrity": "sha512-a29fsXd2G0KMRqIFTpRgpSbWaNBK3lpCTOLuGLEDnlHWdjB8fwl6zyYZ8xCrqkJdatwZb4mGHiEfJjnw0Q6AwQ==", - "dev": true, - "dependencies": { - "@vue/compiler-sfc": "2.7.15", - "csstype": "^3.1.0" - } - }, - "node_modules/vue-cli-plugin-i18n/node_modules/vue-i18n": { - "version": "8.28.2", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.28.2.tgz", - "integrity": "sha512-C5GZjs1tYlAqjwymaaCPDjCyGo10ajUphiwA922jKt9n7KPpqR7oM1PCwYzhB/E7+nT3wfdG3oRre5raIT1rKA==", - "dev": true - }, "node_modules/vue-component-type-helpers": { "version": "1.8.25", "resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-1.8.25.tgz", @@ -16559,361 +16230,6 @@ "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", "dev": true }, - "node_modules/vue-i18n": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.1.10.tgz", - "integrity": "sha512-jpr7gV5KPk4n+sSPdpZT8Qx3XzTcNDWffRlHV/cT2NUyEf+sEgTTmLvnBAibjOFJ0zsUyZlVTAWH5DDnYep+1g==", - "dependencies": { - "@intlify/core-base": "9.1.10", - "@intlify/shared": "9.1.10", - "@intlify/vue-devtools": "9.1.10", - "@vue/devtools-api": "^6.0.0-beta.7" - }, - "engines": { - "node": ">= 10" - }, - "peerDependencies": { - "vue": "^3.0.0" - } - }, - "node_modules/vue-i18n-extract": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/vue-i18n-extract/-/vue-i18n-extract-1.0.2.tgz", - "integrity": "sha512-+zwDKvle4KcfloXZnj5hF01ViKDiFr5RMx5507D7oyDXpSleRpekF5YHgZa/+Ra6Go68//z0Nya58J9tKFsCjw==", - "dev": true, - "dependencies": { - "cli-table3": "^0.5.1", - "dot-object": "^1.7.1", - "esm": "^3.2.13", - "glob": "^7.1.3", - "is-valid-glob": "^1.0.0", - "yargs": "^13.2.2" - }, - "bin": { - "vue-i18n-extract": "dist-node/index.bin.js" - } - }, - "node_modules/vue-i18n-extract/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/vue-i18n-extract/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/cli-table3": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", - "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.0", - "string-width": "^2.1.1" - }, - "engines": { - "node": ">=6" - }, - "optionalDependencies": { - "colors": "^1.1.2" - } - }, - "node_modules/vue-i18n-extract/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/vue-i18n-extract/node_modules/cliui/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/cliui/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/cliui/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/vue-i18n-extract/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/vue-i18n-extract/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/vue-i18n-extract/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/vue-i18n-extract/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/vue-i18n-extract/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/wrap-ansi/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/vue-i18n-extract/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/vue-i18n-extract/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/vue-i18n-extract/node_modules/yargs/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/yargs/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n-extract/node_modules/yargs/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/vue-i18n/node_modules/@intlify/core-base": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.1.10.tgz", - "integrity": "sha512-So9CNUavB/IsZ+zBmk2Cv6McQp6vc2wbGi1S0XQmJ8Vz+UFcNn9MFXAe9gY67PreIHrbLsLxDD0cwo1qsxM1Nw==", - "dependencies": { - "@intlify/devtools-if": "9.1.10", - "@intlify/message-compiler": "9.1.10", - "@intlify/message-resolver": "9.1.10", - "@intlify/runtime": "9.1.10", - "@intlify/shared": "9.1.10", - "@intlify/vue-devtools": "9.1.10" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/vue-i18n/node_modules/@intlify/message-compiler": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.1.10.tgz", - "integrity": "sha512-+JiJpXff/XTb0EadYwdxOyRTB0hXNd4n1HaJ/a4yuV960uRmPXaklJsedW0LNdcptd/hYUZtCkI7Lc9J5C1gxg==", - "dependencies": { - "@intlify/message-resolver": "9.1.10", - "@intlify/shared": "9.1.10", - "source-map": "0.6.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/vue-i18n/node_modules/@intlify/shared": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.1.10.tgz", - "integrity": "sha512-Om54xJeo1Vw+K1+wHYyXngE8cAbrxZHpWjYzMR9wCkqbhGtRV5VLhVc214Ze2YatPrWlS2WSMOWXR8JktX/IgA==", - "engines": { - "node": ">= 10" - } - }, "node_modules/vue-loader": { "version": "17.3.1", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-17.3.1.tgz", @@ -17593,12 +16909,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/which-module": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "dev": true - }, "node_modules/which-typed-array": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", @@ -18136,26 +17446,6 @@ "node": ">= 6" } }, - "node_modules/yaml-eslint-parser": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-0.3.2.tgz", - "integrity": "sha512-32kYO6kJUuZzqte82t4M/gB6/+11WAuHiEnK7FreMo20xsCKPeFH5tDBU7iWxR7zeJpNnMXfJyXwne48D0hGrg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.3.0", - "lodash": "^4.17.20", - "yaml": "^1.10.0" - } - }, - "node_modules/yaml-eslint-parser/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/package.json b/package.json index 072a2ca4..cae0b538 100644 --- a/package.json +++ b/package.json @@ -30,14 +30,12 @@ "mitt": "^2.1.0", "register-service-worker": "^1.7.1", "vue": "^3.2.26", - "vue-i18n": "~9.1.6", "vue-router": "^4.0.12", "vuex": "^4.0.0", "vuex-persistedstate": "^4.0.0-beta.3" }, "devDependencies": { "@capacitor/cli": "2.4.6", - "@intlify/vue-i18n-loader": "^2.0.0-rc.3", "@types/luxon": "^3.2.0", "@typescript-eslint/eslint-plugin": "~5.26.0", "@typescript-eslint/parser": "~5.26.0", @@ -54,7 +52,6 @@ "cypress": "^8.3.0", "eslint": "^7.32.0", "eslint-plugin-vue": "^8.0.3", - "typescript": "~4.7.4", - "vue-cli-plugin-i18n": "^1.0.1" + "typescript": "~4.7.4" } } diff --git a/vue.config.js b/vue.config.js index c1c262f8..095a898e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,14 +1,6 @@ const path = require('path') require("@hotwax/app-version-info") module.exports = { - pluginOptions: { - i18n: { - locale: 'en', - fallbackLocale: 'en', - localeDir: 'locales', - enableInSFC: true - } - }, configureWebpack: { resolve: { alias: { From a1151b0f4fed828c0a3b626f9dba26cf46b1d529 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Fri, 22 Mar 2024 15:26:26 +0530 Subject: [PATCH 2/4] Implemented: support to use i18n from dxp and removed app level configuration of i18n(#280) --- .env.example | 4 +- src/App.vue | 13 ++- src/components/Menu.vue | 7 +- src/i18n/index.ts | 29 ----- src/{i18n => }/locales/en.json | 0 src/{i18n => }/locales/index.ts | 0 src/main.ts | 4 +- src/router/index.ts | 2 +- src/store/modules/order/actions.ts | 2 +- src/store/modules/product/actions.ts | 2 +- src/store/modules/user/actions.ts | 2 +- src/user-utils/index.ts | 2 +- src/views/background-job-modal.vue | 12 +- src/views/catalog-product-details.vue | 157 +++++++++++++------------- src/views/catalog.vue | 24 ++-- src/views/edit-shipping-modal.vue | 16 +-- src/views/job-actions-popover.vue | 21 ++-- src/views/job-history-modal.vue | 6 +- src/views/order-popover.vue | 28 ++--- src/views/orders.vue | 76 +++++++------ src/views/product-details.vue | 74 ++++++------ src/views/products.vue | 14 ++- src/views/promise-date-modal.vue | 20 ++-- src/views/settings.vue | 27 ++--- src/views/shipping-popover.vue | 8 +- src/views/timezone-modal.vue | 20 ++-- src/views/warehouse-modal.vue | 20 ++-- 27 files changed, 296 insertions(+), 294 deletions(-) delete mode 100644 src/i18n/index.ts rename src/{i18n => }/locales/en.json (100%) rename src/{i18n => }/locales/index.ts (100%) diff --git a/.env.example b/.env.example index 6002fc9c..3f55fb18 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,8 @@ VUE_APP_CACHE_MAX_AGE=3600 VUE_APP_BASE_URL=VUE_APP_BASE_URL VUE_APP_RESOURCE_URL=VUE_APP_RESOURCE_URL -VUE_APP_I18N_LOCALE=en -VUE_APP_I18N_FALLBACK_LOCALE=en +VUE_APP_I18N_LOCALE=en-US +VUE_APP_I18N_FALLBACK_LOCALE=en-US VUE_APP_VIEW_SIZE=10 VUE_APP_CUST_LOYALTY_OPTIONS={"LoyaltyCustomer":"Pass", "LoyaltyPlusOrder":"Pass +"} VUE_APP_POLL_TIME=10000 diff --git a/src/App.vue b/src/App.vue index 5a592701..9ff81687 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,7 +15,7 @@ import { } from "@ionic/vue"; import Menu from '@/components/Menu.vue'; import { defineComponent } from "vue"; -import { useI18n } from 'vue-i18n' +// import { useI18n } from 'vue-i18n' import TaskQueue from './task-queue'; import OfflineHelper from "./offline-helper" import emitter from "@/event-bus" @@ -24,6 +24,7 @@ import { mapGetters, useStore } from 'vuex'; import { Settings } from 'luxon' import { initialise, resetConfig } from '@/adapter' import { useRouter } from 'vue-router'; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "App", @@ -51,7 +52,7 @@ export default defineComponent({ if (!this.loader) { this.loader = await loadingController .create({ - message: this.$t("Click the backdrop to dismiss."), + message: translate("Click the backdrop to dismiss."), translucent: true, backdropDismiss: true }); @@ -90,7 +91,7 @@ export default defineComponent({ async mounted() { this.loader = await loadingController .create({ - message: this.$t("Click the backdrop to dismiss."), + message: translate("Click the backdrop to dismiss."), translucent: true, backdropDismiss: true }); @@ -111,14 +112,14 @@ export default defineComponent({ const store = useStore(); TaskQueue.init(); OfflineHelper.register(); - const { t, locale } = useI18n(); + // const { t, locale } = useI18n(); const router = useRouter(); return { router, TaskQueue, OfflineHelper, - t, - locale, + // t, + // locale, store }; }, diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 214da3f3..8bff4a21 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -2,7 +2,7 @@ - {{ $t("Preorder Management")}} + {{ translate("Preorder Management")}} @@ -40,7 +40,7 @@ import { } from "@ionic/vue"; import { computed, defineComponent} from "vue" import { mapGetters } from "vuex"; - +import { translate } from "@hotwax/dxp-components"; import { albums ,shirt, pricetags, settings } from "ionicons/icons"; import { useStore } from "@/store"; import { useRouter } from "vue-router"; @@ -124,7 +124,8 @@ export default defineComponent({ settings, selectedIndex, shirt, - store + store, + translate }; } }); diff --git a/src/i18n/index.ts b/src/i18n/index.ts deleted file mode 100644 index 5e2fc7e5..00000000 --- a/src/i18n/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createI18n } from 'vue-i18n' - -function loadLocaleMessages () { - const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i) - const messages: any = {} - locales.keys().forEach(key => { - const matched = key.match(/([A-Za-z0-9-_]+)\./i) - if (matched && matched.length > 1) { - const locale = matched[1] - messages[locale] = locales(key) - } - }) - return messages -} - -const i18n = createI18n({ - locale: process.env.VUE_APP_I18N_LOCALE || 'en', - fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en', - messages: loadLocaleMessages() -}) - -const translate = (key: string) => { - if (!key) { - return ''; - } - return i18n.global.t(key); -}; - -export { i18n as default, translate } \ No newline at end of file diff --git a/src/i18n/locales/en.json b/src/locales/en.json similarity index 100% rename from src/i18n/locales/en.json rename to src/locales/en.json diff --git a/src/i18n/locales/index.ts b/src/locales/index.ts similarity index 100% rename from src/i18n/locales/index.ts rename to src/locales/index.ts diff --git a/src/main.ts b/src/main.ts index f799e2f2..6158dee8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,7 +3,6 @@ import App from './App.vue' import router from './router'; import { IonicVue } from '@ionic/vue'; -import i18n from './i18n' import store from './store' import { DateTime } from 'luxon'; import { sortSizes } from "@/apparel-sorter" @@ -33,14 +32,13 @@ import permissionPlugin from '@/authorization'; import permissionRules from '@/authorization/Rules'; import permissionActions from '@/authorization/Actions'; import { getConfig, initialise } from '@/adapter' -import localeMessages from './i18n/locales'; +import localeMessages from './locales'; const app = createApp(App) .use(IonicVue, { mode: 'md' }) .use(router) - .use(i18n) .use(store) .use(permissionPlugin, { rules: permissionRules, diff --git a/src/router/index.ts b/src/router/index.ts index 62d4a0b5..b014cd04 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,7 +11,7 @@ import { DxpLogin, useAuthStore } from '@hotwax/dxp-components'; import { loader } from '@/user-utils'; import { hasPermission } from '@/authorization'; import { showToast } from '@/utils'; -import { translate } from '@/i18n'; +import { translate } from '@hotwax/dxp-components'; // Defining types for the meta values declare module 'vue-router' { diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 4475a026..94a35f8c 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -4,7 +4,7 @@ import RootState from '@/store/RootState' import OrderState from './OrderState' import * as types from './mutation-types' import { hasError, showToast } from '@/utils' -import { translate } from '@/i18n' +import { translate } from '@hotwax/dxp-components' import { DateTime } from 'luxon'; import emitter from '@/event-bus' diff --git a/src/store/modules/product/actions.ts b/src/store/modules/product/actions.ts index 49da7505..032da995 100644 --- a/src/store/modules/product/actions.ts +++ b/src/store/modules/product/actions.ts @@ -4,7 +4,7 @@ import RootState from '@/store/RootState' import ProductState from './ProductState' import * as types from './mutation-types' import { hasError, showToast } from '@/utils' -import { translate } from '@/i18n' +import { translate } from '@hotwax/dxp-components' import emitter from '@/event-bus' diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index a17187aa..f66ec7b6 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -4,7 +4,7 @@ import RootState from '@/store/RootState' import UserState from './UserState' import * as types from './mutation-types' import { hasError, showToast } from '@/utils' -import { translate } from '@/i18n' +import { translate } from '@hotwax/dxp-components' import { Settings } from 'luxon' import { updateInstanceUrl, updateToken, resetConfig, logout } from '@/adapter' import { useAuthStore } from '@hotwax/dxp-components'; diff --git a/src/user-utils/index.ts b/src/user-utils/index.ts index 44c37aba..48096522 100644 --- a/src/user-utils/index.ts +++ b/src/user-utils/index.ts @@ -1,4 +1,4 @@ -import { translate } from '@/i18n' +import { translate } from '@hotwax/dxp-components' import store from '@/store' import { loadingController } from '@ionic/vue' diff --git a/src/views/background-job-modal.vue b/src/views/background-job-modal.vue index 4f375184..5e56572a 100644 --- a/src/views/background-job-modal.vue +++ b/src/views/background-job-modal.vue @@ -6,7 +6,7 @@ - {{ $t("Background jobs") }} + {{ translate("Background jobs") }} @@ -14,13 +14,13 @@
-

{{ $t("There are no jobs running in the background right now.") }}

+

{{ translate("There are no jobs running in the background right now.") }}

- {{ $t("Active jobs") }} + {{ translate("Active jobs") }} {{ log.scriptTitle ? log.scriptTitle : log.description }} @@ -28,7 +28,7 @@ - {{ $t("Broker orders") }} + {{ translate("Broker orders") }} {{ job.runTime ? getDateTime(job.runTime) : '-' }} @@ -57,6 +57,7 @@ import { JobService } from '@/services/JobService' import { useStore } from "@/store"; import { mapGetters } from "vuex"; import { DateTime } from 'luxon'; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "BackgroundJobModal", @@ -104,7 +105,8 @@ export default defineComponent({ cloudDownload, build, closeOutline, - store + store, + translate }; }, }); diff --git a/src/views/catalog-product-details.vue b/src/views/catalog-product-details.vue index 363b7ad5..36336b97 100644 --- a/src/views/catalog-product-details.vue +++ b/src/views/catalog-product-details.vue @@ -5,7 +5,7 @@ - {{ $t("Product audit") }} + {{ translate("Product audit") }} @@ -23,7 +23,7 @@
- {{ $t("Colors") }} + {{ translate("Colors") }} @@ -34,7 +34,7 @@ - {{ $t("Sizes") }} + {{ translate("Sizes") }} @@ -71,19 +71,19 @@
- {{ $t("Eligible") }} + {{ translate("Eligible") }} - {{ $t("Category") }} + {{ translate("Category") }} - {{ $t("Shopify listing") }} + {{ translate("Shopify listing") }} - {{ $t("Timeline") }} + {{ translate("Timeline") }} @@ -99,25 +99,25 @@ - {{ $t("Eligible") }} - {{ poSummary.eligible ? $t("Yes") : $t("No") }} + {{ translate("Eligible") }} + {{ poSummary.eligible ? translate("Yes") : translate("No") }} - {{ $t("Category") }} - {{ poSummary.categoryId === preOrderCategoryId ? $t('Pre-order') : poSummary.categoryId === backorderCategoryId ? $t('Back-order') : $t('None') }} + {{ translate("Category") }} + {{ poSummary.categoryId === preOrderCategoryId ? translate('Pre-order') : poSummary.categoryId === backorderCategoryId ? translate('Back-order') : translate('None') }} - {{ $t("Shopify listing") }} + {{ translate("Shopify listing") }} {{ poSummary.listingCountStatusMessage }} - {{ $t("Promise date") }} + {{ translate("Promise date") }} {{ poSummary.promiseDate }} - {{ $t("Timeline") }} + {{ translate("Timeline") }} @@ -160,8 +160,8 @@ -

{{ $t("Active purchase order") }}

-

{{ $t("Available purchase order") }}

+

{{ translate("Active purchase order") }}

+

{{ translate("Available purchase order") }}

@@ -171,49 +171,49 @@
- {{ $t('Pre-selling category') }} - {{ poAndAtpDetails.activePo?.isNewProduct === "Y" ? $t('Pre-order') : $t('Back-order') }} + {{ translate('Pre-selling category') }} + {{ poAndAtpDetails.activePo?.isNewProduct === "Y" ? translate('Pre-order') : translate('Back-order') }} - {{ $t("Ordered") }} + {{ translate("Ordered") }} {{ (poAndAtpDetails.activePo?.quantity >= 0) ? poAndAtpDetails.activePo?.quantity : '-' }} - {{ $t("Available") }} + {{ translate("Available") }} {{ (poAndAtpDetails.activePo?.availableToPromise >= 0) ? poAndAtpDetails.activePo?.availableToPromise : '-' }} - {{ $t("Corresponding sales orders") }} + {{ translate("Corresponding sales orders") }} {{ (poAndAtpDetails.crspndgSalesOrdr >= 0) ? poAndAtpDetails.crspndgSalesOrdr : '-' }} - {{ $t("Total PO items") }} + {{ translate("Total PO items") }} {{ (poAndAtpDetails.totalPoItems >= 0) ? poAndAtpDetails.totalPoItems : '-' }} - {{ $t("Total PO ATP") }} + {{ translate("Total PO ATP") }} {{ (poAndAtpDetails.totalPoAtp >= 0) ? poAndAtpDetails.totalPoAtp : '-' }}
-

{{ $t("Purchase orders") }}

+

{{ translate("Purchase orders") }}

- {{ $t("Total PO items") }} + {{ translate("Total PO items") }} {{ (poAndAtpDetails.totalPoItems >= 0) ? poAndAtpDetails.totalPoItems : '-' }} - {{ $t("Total PO ATP") }} + {{ translate("Total PO ATP") }} {{ (poAndAtpDetails.totalPoAtp >= 0) ? poAndAtpDetails.totalPoAtp : '-' }}
@@ -221,7 +221,7 @@ -

{{ $t("Online ATP calculation") }}

+

{{ translate("Online ATP calculation") }}

@@ -243,23 +243,23 @@
- {{ $t("Online ATP") }} + {{ translate("Online ATP") }} {{ (atpCalcDetails.onlineAtp >= 0) ? atpCalcDetails.onlineAtp : '-' }} - {{ $t("Quantity on hand") }} + {{ translate("Quantity on hand") }} {{ (atpCalcDetails.totalQOH >= 0) ? atpCalcDetails.totalQOH : '-' }} - {{ $t("Excluded ATP") }} + {{ translate("Excluded ATP") }} {{ (atpCalcDetails.excludedAtp || atpCalcDetails.excludedAtp === 0) ? atpCalcDetails.excludedAtp : '-' }} - {{ $t("Reserve inventory") }} + {{ translate("Reserve inventory") }} - {{ $t("Hold pre-order physical inventory") }} + {{ translate("Hold pre-order physical inventory") }}
@@ -272,7 +272,7 @@ -

{{ $t('Related jobs') }}

+

{{ translate('Related jobs') }}

@@ -289,31 +289,31 @@
-

{{ $t('Pre-sell computation') }}

+

{{ translate('Pre-sell computation') }}

{{ getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT').lastRunTime && timeTillJob(getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT').lastRunTime) }}

-

{{ getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT').runTime ? timeTillJob(getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT').runTime) : $t('disabled')}}

+

{{ getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT').runTime ? timeTillJob(getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT').runTime) : translate('disabled')}}

-

{{ $t('Order brokering') }}

+

{{ translate('Order brokering') }}

{{ getCtgryAndBrkrngJob('JOB_BKR_ORD').lastRunTime && timeTillJob(getCtgryAndBrkrngJob('JOB_BKR_ORD').lastRunTime) }}

-

{{ getCtgryAndBrkrngJob('JOB_BKR_ORD').runTime ? timeTillJob(getCtgryAndBrkrngJob('JOB_BKR_ORD').runTime) : $t('disabled')}}

+

{{ getCtgryAndBrkrngJob('JOB_BKR_ORD').runTime ? timeTillJob(getCtgryAndBrkrngJob('JOB_BKR_ORD').runTime) : translate('disabled')}}

-

{{ $t('Auto releasing') }}

+

{{ translate('Auto releasing') }}

{{ getCtgryAndBrkrngJob('JOB_RLS_ORD_DTE').lastRunTime && timeTillJob(getCtgryAndBrkrngJob('JOB_RLS_ORD_DTE').lastRunTime) }}

-

{{ getCtgryAndBrkrngJob('JOB_RLS_ORD_DTE').runTime ? timeTillJob(getCtgryAndBrkrngJob('JOB_RLS_ORD_DTE').runTime) : $t('disabled')}}

+

{{ getCtgryAndBrkrngJob('JOB_RLS_ORD_DTE').runTime ? timeTillJob(getCtgryAndBrkrngJob('JOB_RLS_ORD_DTE').runTime) : translate('disabled')}}

@@ -322,7 +322,7 @@ -

{{ $t('Shop listing status') }}

+

{{ translate('Shop listing status') }}

@@ -338,7 +338,7 @@
- {{ $t('No shop listings found') }} + {{ translate('No shop listings found') }} @@ -347,13 +347,13 @@

{{ listData.listingTimeAndStatus }}

-
{{ $t(listData.listingStatus) }}
+
{{ translate(listData.listingStatus) }}
-
{{ $t("No listing data") }}
+
{{ translate("No listing data") }}
-
{{ $t("Not linked") }}
+
{{ translate("Not linked") }}
@@ -400,7 +400,7 @@ import { useStore } from "@/store"; import { DxpShopifyImg } from "@hotwax/dxp-components"; import { mapGetters } from "vuex"; import { showToast, getFeature, hasError } from "@/utils"; -import { translate } from "@/i18n"; +import { translate } from "@hotwax/dxp-components"; import { sortSizes } from '@/apparel-sorter'; import { DateTime } from "luxon"; import JobActionsPopover from "./job-actions-popover.vue"; @@ -601,7 +601,7 @@ export default defineComponent({ if (!hasError(resp)) { this.poAndAtpDetails.totalPoAtp = resp.data?.futureAtp } else if (hasError(resp) && resp?.data?.error !== "No record found") { - showToast(this.$t("Something went wrong, could not fetch", { data: 'total ATP' })) + showToast(translate("Something went wrong, could not fetch", { data: 'total ATP' })) } const hasPreOrderCategory = productCategories?.includes(this.preOrderCategoryId); @@ -643,7 +643,7 @@ export default defineComponent({ resp = await OrderService.getActivePoDetails(payload) - if (hasError(resp) && resp?.data?.error !== "No record found") showToast(this.$t("Something went wrong, could not fetch", { data: 'active PO details' })) + if (hasError(resp) && resp?.data?.error !== "No record found") showToast(translate("Something went wrong, could not fetch", { data: 'active PO details' })) else this.poAndAtpDetails.activePo = resp.data?.error ? {}: resp.data?.docs[0] } else if (this.poAndAtpDetails.totalPoAtp > 0) { @@ -666,7 +666,7 @@ export default defineComponent({ resp = await OrderService.getActivePoDetails(payload) - if (hasError(resp) && resp?.data?.error !== "No record found") showToast(this.$t("Something went wrong, could not fetch", { data: 'active PO details' })) + if (hasError(resp) && resp?.data?.error !== "No record found") showToast(translate("Something went wrong, could not fetch", { data: 'active PO details' })) else { this.poAndAtpDetails.activePo = resp.data?.error ? {}: resp.data?.docs[0] this.poAndAtpDetails.activePoId = this.poAndAtpDetails.activePo.orderId @@ -684,7 +684,7 @@ export default defineComponent({ } } resp = await OrderService.getCrspndgSalesOrdr(payload) - if (resp && hasError(resp)) showToast(this.$t("Something went wrong, could not fetch", { data: 'corresponding sales order count' })) + if (resp && hasError(resp)) showToast(translate("Something went wrong, could not fetch", { data: 'corresponding sales order count' })) else this.poAndAtpDetails.crspndgSalesOrdr = resp?.data?.response.numFound } @@ -703,7 +703,7 @@ export default defineComponent({ "viewSize": 1 } resp = await OrderService.getPoItemCount(payload) - if (hasError(resp) && resp?.data?.error !== "No record found") showToast(this.$t("Something went wrong, could not fetch", { data: 'total PO items' })) + if (hasError(resp) && resp?.data?.error !== "No record found") showToast(translate("Something went wrong, could not fetch", { data: 'total PO items' })) else this.poAndAtpDetails.totalPoItems = resp.data?.error === "No record found" ? 0 : resp.data?.count // count is zero if not records are found @@ -727,10 +727,10 @@ export default defineComponent({ const promiseResult = await Promise.allSettled(requests) // promise.allSettled returns an array of result with status and value fields let resp = promiseResult.map((respone: any) => respone.value) as any - if (hasError(resp[0]) && resp[0]?.data?.error !== "No record found") showToast(this.$t("Something went wrong, could not fetch", { data: 'quantity on hand' })) + if (hasError(resp[0]) && resp[0]?.data?.error !== "No record found") showToast(translate("Something went wrong, could not fetch", { data: 'quantity on hand' })) else this.atpCalcDetails.totalQOH = resp[0].data?.quantityOnHandTotal - if (hasError(resp[1]) && resp[1]?.data?.error !== "No record found") showToast(this.$t("Something went wrong, could not fetch", { data: 'online ATP' })) + if (hasError(resp[1]) && resp[1]?.data?.error !== "No record found") showToast(translate("Something went wrong, could not fetch", { data: 'online ATP' })) else this.atpCalcDetails.onlineAtp = resp[1].data?.onlineAtp if (typeof resp[0].data?.availableToPromiseTotal === 'number' && typeof this.atpCalcDetails.onlineAtp === 'number') { @@ -872,45 +872,45 @@ export default defineComponent({ if (this.poSummary.eligible && hasCategory) { const categoryName = hasPreOrderCategory ? 'pre-order' : 'back-order'; if (this.poAndAtpDetails.activePoFromDate) { - this.poSummary.header = this.$t("Added to at", { categoryName, addedDateTime: this.getDateTime(this.poAndAtpDetails.activePoFromDate) }); + this.poSummary.header = translate("Added to at", { categoryName, addedDateTime: this.getDateTime(this.poAndAtpDetails.activePoFromDate) }); } else { - this.poSummary.header = this.$t("Added to", { categoryName }); + this.poSummary.header = translate("Added to", { categoryName }); } - this.poSummary.body = this.$t("When this product entered there was no sellable inventory and was available in", { categoryName, poItemATP: this.poAndAtpDetails.activePo.quantity , poId: this.poAndAtpDetails.activePo.orderExternalId ? this.poAndAtpDetails.activePo.orderExternalId : this.poAndAtpDetails.activePo.orderId }); + this.poSummary.body = translate("When this product entered there was no sellable inventory and was available in", { categoryName, poItemATP: this.poAndAtpDetails.activePo.quantity , poId: this.poAndAtpDetails.activePo.orderExternalId ? this.poAndAtpDetails.activePo.orderExternalId : this.poAndAtpDetails.activePo.orderId }); } else if (!this.poSummary.eligible && !hasCategory) { const presellingJob = this.getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT'); if (Object.keys(presellingJob).length === 0 || !presellingJob.runTime) { - this.poSummary.header = this.$t("Pre-sell processing disabled"); + this.poSummary.header = translate("Pre-sell processing disabled"); } else { - this.poSummary.header = this.$t("Preselling processed at", { processingDateTime: this.getDateTime(presellingJob.runTime) }); + this.poSummary.header = translate("Preselling processed at", { processingDateTime: this.getDateTime(presellingJob.runTime) }); } if (this.atpCalcDetails.onlineAtp > 0) { - this.poSummary.body = this.$t("This product is not preselling because it is in stock."); + this.poSummary.body = translate("This product is not preselling because it is in stock."); } else { - this.poSummary.body = this.$t("This product is not preselling because there is no active PO available for it."); + this.poSummary.body = translate("This product is not preselling because there is no active PO available for it."); } } else if (this.poSummary.eligible && !hasCategory) { const categoryName = this.poAndAtpDetails.activePo?.isNewProduct === "Y" ? 'pre-order' : 'back-order'; const presellingJob = this.getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT'); if (Object.keys(presellingJob).length === 0 || !presellingJob.runTime) { - this.poSummary.header = this.$t("Pre-sell processing disabled"); + this.poSummary.header = translate("Pre-sell processing disabled"); } else { - this.poSummary.header = this.$t("Adding to", { categoryName, addingTime: this.timeTillJob(presellingJob.runTime) }); + this.poSummary.header = translate("Adding to", { categoryName, addingTime: this.timeTillJob(presellingJob.runTime) }); } - this.poSummary.body = this.$t("This product will begin pre-selling because it is out of stock and purchase order is available.", { poId: this.poAndAtpDetails.activePo.orderExternalId ? this.poAndAtpDetails.activePo.orderExternalId : this.poAndAtpDetails.activePo.orderId }); + this.poSummary.body = translate("This product will begin pre-selling because it is out of stock and purchase order is available.", { poId: this.poAndAtpDetails.activePo.orderExternalId ? this.poAndAtpDetails.activePo.orderExternalId : this.poAndAtpDetails.activePo.orderId }); } else if (!this.poSummary.eligible && hasCategory) { const categoryName = hasPreOrderCategory ? 'pre-order' : 'back-order'; const presellingJob = this.getCtgryAndBrkrngJob('JOB_REL_PREODR_CAT'); if (Object.keys(presellingJob).length === 0 || !presellingJob.runTime) { - this.poSummary.header = this.$t("Pre-sell processing disabled"); + this.poSummary.header = translate("Pre-sell processing disabled"); } else { const headerMessage = this.isPastTime(presellingJob.runTime) ? "Removed from" : "Removing from"; - this.poSummary.header = this.$t(headerMessage, { categoryName, removeTime: this.timeTillJob(presellingJob.runTime) }); + this.poSummary.header = translate(headerMessage, { categoryName, removeTime: this.timeTillJob(presellingJob.runTime) }); } if (this.atpCalcDetails.onlineAtp > 0) { - this.poSummary.body = this.$t("This product will be removed from because it is in stock", { categoryName }); + this.poSummary.body = translate("This product will be removed from because it is in stock", { categoryName }); } else { - this.poSummary.body = this.$t("This product will be removed from because it doesn’t have active purchase orders", { categoryName }); + this.poSummary.body = translate("This product will be removed from because it doesn’t have active purchase orders", { categoryName }); } } @@ -944,17 +944,17 @@ export default defineComponent({ // Checking if we have the data const shopListingsWithMissingData = shopListings.filter((shopifyListing: any) => !shopifyListing.status) if (shopListingsWithMissingData.length === shopListings.length) { - this.poSummary.listingCountStatusMessage = this.$t("Listing data not available") + this.poSummary.listingCountStatusMessage = translate("Listing data not available") } else if (shopListingsWithMissingData.length > 0) { - this.poSummary.listingCountStatusMessage = this.$t("Some listing data not available") + this.poSummary.listingCountStatusMessage = translate("Some listing data not available") } else if (!this.poSummary.listedCount) { - this.poSummary.listingCountStatusMessage = this.$t("Not listed on any stores") + this.poSummary.listingCountStatusMessage = translate("Not listed on any stores") } else if (shopListings.length === this.poSummary.listedCount) { - this.poSummary.listingCountStatusMessage = this.$t("Listed on all stores") + this.poSummary.listingCountStatusMessage = translate("Listed on all stores") } else if (shopListings.length > this.poSummary.listedCount) { this.poSummary.eligible - ? this.poSummary.listingCountStatusMessage = this.$t("Not listed on store(s)", { count: this.configsByStores.length - this.poSummary.listedCount }) - : this.poSummary.listingCountStatusMessage = this.$t("Listed on store(s)", { count: this.poSummary.listedCount }) + ? this.poSummary.listingCountStatusMessage = translate("Not listed on store(s)", { count: this.configsByStores.length - this.poSummary.listedCount }) + : this.poSummary.listingCountStatusMessage = translate("Listed on store(s)", { count: this.poSummary.listedCount }) } // Get the first record with promise date const shopListingWithPromiseDate = shopListings.find((shopifyListing: any) => shopifyListing.status === 'active' && shopifyListing.promiseDate) @@ -1063,20 +1063,20 @@ export default defineComponent({ if (!listData.containsError) { if (listData.status === 'inactive') { // showing the job's runTime as listing time, and not showing listing time if not present - listingTime && (listData.listingTimeAndStatus = this.$t("Delisted at", { listingTime })) + listingTime && (listData.listingTimeAndStatus = translate("Delisted at", { listingTime })) listData.listingStatus = 'Not listed' } else { - listingTime && (listData.listingTimeAndStatus = this.$t("Listed at", { listingTime })) + listingTime && (listData.listingTimeAndStatus = translate("Listed at", { listingTime })) listData.listingStatus = 'Listed' } } else { // If it failed to update, considered the status must old if (listData.status === 'inactive') { // showing the job's runTime as listing time - listingTime && (listData.listingTimeAndStatus = this.$t("Delisting failed at", { listingTime })) + listingTime && (listData.listingTimeAndStatus = translate("Delisting failed at", { listingTime })) listData.listingStatus = 'Listed' } else { - listingTime && (listData.listingTimeAndStatus = this.$t("Listing failed at", { listingTime })) + listingTime && (listData.listingTimeAndStatus = translate("Listing failed at", { listingTime })) listData.listingStatus = 'Not listed' } } @@ -1110,7 +1110,7 @@ export default defineComponent({ await Clipboard.write({ string: auditMsg }).then(() => { - showToast(this.$t("Copied to clipboard")); + showToast(translate("Copied to clipboard")); }) }, getSortedShopListings(shopListings: any) { @@ -1131,7 +1131,8 @@ export default defineComponent({ hasPermission, router, shirtOutline, - store + store, + translate }; }, }); diff --git a/src/views/catalog.vue b/src/views/catalog.vue index fa00d453..3379ffe7 100644 --- a/src/views/catalog.vue +++ b/src/views/catalog.vue @@ -5,7 +5,7 @@ - {{ $t("Catalog") }} + {{ translate("Catalog") }} @@ -13,11 +13,11 @@
- + - {{ $t(filter.name) }} + {{ translate(filter.name) }} @@ -25,15 +25,15 @@
- {{ $t('Jobs') }} + {{ translate('Jobs') }} -
{{ $t('Pre-sell computation') }}
+
{{ translate('Pre-sell computation') }}

{{ preordBckordComputationJob.lastRunTime && timeTillJob(preordBckordComputationJob.lastRunTime) }}

-

{{ preordBckordComputationJob.runTime ? timeTillJob(preordBckordComputationJob.runTime) : $t('disabled')}}

+

{{ preordBckordComputationJob.runTime ? timeTillJob(preordBckordComputationJob.runTime) : translate('disabled')}}

@@ -43,7 +43,7 @@
- {{ $t('No products found') }} + {{ translate('No products found') }}
@@ -58,27 +58,27 @@ - {{ product.prodCatalogCategoryTypeIds.includes('PCCT_PREORDR') ? $t('Pre-order') : product.prodCatalogCategoryTypeIds.includes('PCCT_BACKORDER') ? $t('Back-order') : '-' }} + {{ product.prodCatalogCategoryTypeIds.includes('PCCT_PREORDR') ? translate('Pre-order') : product.prodCatalogCategoryTypeIds.includes('PCCT_BACKORDER') ? translate('Back-order') : '-' }}
- +
@@ -114,6 +114,7 @@ import { mapGetters } from 'vuex'; import { DateTime } from 'luxon'; import { JobService } from '@/services/JobService'; import { hasError } from '@/utils'; +import { translate } from '@hotwax/dxp-components'; export default defineComponent({ name: 'Catalog', @@ -277,6 +278,7 @@ export default defineComponent({ return { router, store, + translate }; }, }); diff --git a/src/views/edit-shipping-modal.vue b/src/views/edit-shipping-modal.vue index b8dc7f2a..13227b52 100644 --- a/src/views/edit-shipping-modal.vue +++ b/src/views/edit-shipping-modal.vue @@ -6,7 +6,7 @@ - {{ $t("Edit shipping date") }} + {{ translate("Edit shipping date") }} @@ -14,29 +14,29 @@ - {{ $t("Custom") }} + {{ translate("Custom") }} - {{ $t("Ships from date") }} + {{ translate("Ships from date") }} - {{ $t("Auto") }} + {{ translate("Auto") }} - {{ $t("Purchase orders") }} + {{ translate("Purchase orders") }} 12345 -

{{ $t("ATP") }}: 30

+

{{ translate("ATP") }}: 30

12 Feb 2021
@@ -44,7 +44,7 @@ 67890 -

{{ $t("ATP") }}: 50

+

{{ translate("ATP") }}: 50

12 Feb 2021
@@ -81,6 +81,7 @@ import { } from '@ionic/vue'; import { defineComponent } from 'vue'; import { closeOutline, saveOutline } from 'ionicons/icons'; +import { translate } from '@hotwax/dxp-components'; export default defineComponent({ name: 'EditShippingModal', @@ -112,6 +113,7 @@ export default defineComponent({ return { closeOutline, saveOutline, + translate }; }, }); diff --git a/src/views/job-actions-popover.vue b/src/views/job-actions-popover.vue index 4cab508c..b282bb0e 100644 --- a/src/views/job-actions-popover.vue +++ b/src/views/job-actions-popover.vue @@ -4,21 +4,21 @@ - {{ $t("Schedule in every 15 minutes") }} + {{ translate("Schedule in every 15 minutes") }} - {{ $t("Run now") }} + {{ translate("Run now") }} - {{ $t("History") }} + {{ translate("History") }} - {{ $t("Cancel job") }} + {{ translate("Cancel job") }} @@ -45,7 +45,7 @@ import { useStore } from "@/store"; import JobHistoryModal from "./job-history-modal.vue"; import { JobService } from "@/services/JobService"; import { hasError, showToast } from "@/utils"; -import { translate } from "@/i18n"; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "JobActionsPopover", @@ -101,14 +101,14 @@ export default defineComponent({ }, async confirmJobCancellation() { const alert = await alertController.create({ - header: this.$t("Cancel job"), - message: this.$t("The job is currently in progress. Are you sure that you want to cancel this job?"), + header: translate("Cancel job"), + message: translate("The job is currently in progress. Are you sure that you want to cancel this job?"), buttons: [{ - text: this.$t('No'), + text: translate('No'), role: 'cancel', }, { - text: this.$t('Yes'), + text: translate('Yes'), handler: async () => { this.cancelJob() } @@ -140,7 +140,8 @@ export default defineComponent({ flashOutline, store, timeOutline, - timerOutline + timerOutline, + translate } } }); diff --git a/src/views/job-history-modal.vue b/src/views/job-history-modal.vue index 568e6c5c..f6bfaefa 100644 --- a/src/views/job-history-modal.vue +++ b/src/views/job-history-modal.vue @@ -12,7 +12,7 @@
-

{{ $t("No jobs have run yet")}}

+

{{ translate("No jobs have run yet")}}

@@ -50,6 +50,7 @@ import { mapGetters, useStore } from 'vuex'; import { DateTime } from 'luxon'; import { JobService } from '@/services/JobService' import { hasError } from '@/utils'; +import { translate } from '@hotwax/dxp-components'; export default defineComponent({ name: 'JobHistoryModal', @@ -123,7 +124,8 @@ export default defineComponent({ return { closeOutline, - store + store, + translate }; }, }); diff --git a/src/views/order-popover.vue b/src/views/order-popover.vue index a17073d3..4d253c4e 100644 --- a/src/views/order-popover.vue +++ b/src/views/order-popover.vue @@ -1,10 +1,10 @@ @@ -22,6 +22,7 @@ import { defineComponent } from "vue"; import WarehouseModal from "@/views/warehouse-modal.vue"; import { useStore } from "@/store"; import PromiseDateModal from "@/views/promise-date-modal.vue"; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "OrderPopover", @@ -46,20 +47,20 @@ export default defineComponent({ }, releaseAlert: async function () { const alert = await alertController.create({ - header: this.$t("Release item"), + header: translate("Release item"), cssClass: "alert-message", - message: this.$t( + message: translate( 'This item will be automatically brokered and assigned for fulfillment.' ), buttons: [ { - text: this.$t("Cancel"), + text: translate("Cancel"), role: 'cancel', cssClass: 'secondary' }, { - text: this.$t("Release"), + text: translate("Release"), handler: () => { this.releaseItem(this.item).then(() => { this.store.dispatch("order/removeItem", { item: this.item }); @@ -97,18 +98,18 @@ export default defineComponent({ }, async cancelAlert() { const alert = await alertController.create({ - header: this.$t("Cancel item"), - message: this.$t( + header: translate("Cancel item"), + message: translate( 'This item will be cancelled. This action cannot be undone.' ), buttons: [ { - text: this.$t("Don't cancel"), + text: translate("Don't cancel"), role: 'cancel', cssClass: 'secondary' }, { - text: this.$t( "Confirm"), + text: translate( "Confirm"), handler: () => { this.cancelItem(this.item).then(() => { this.store.dispatch("order/removeItem", { item: this.item }) @@ -125,7 +126,8 @@ export default defineComponent({ setup() { const store = useStore(); return { - store + store, + translate } }, components: { diff --git a/src/views/orders.vue b/src/views/orders.vue index 1ddc6b30..8360884b 100644 --- a/src/views/orders.vue +++ b/src/views/orders.vue @@ -5,10 +5,10 @@ - {{ $t("Orders") }} + {{ translate("Orders") }} - {{ selectedItemsCount}} {{ $t("item selected")}} + {{ selectedItemsCount}} {{ translate("item selected")}} @@ -26,7 +26,7 @@
- {{ $t("Ordered after") }} + {{ translate("Ordered after") }}
-

{{ $t("No results found")}}

-

{{ $t("Enter an order ID, product name, style name, SKU, customer name, UPCA or external ID")}}

+

{{ translate("No results found")}}

+

{{ translate("Enter an order ID, product name, style name, SKU, customer name, UPCA or external ID")}}

@@ -108,7 +108,7 @@
@@ -121,21 +121,21 @@

{{ item.parentProductName ? item.parentProductName :item.productName }}

-

{{ $t("Color") }} : {{ $filters.getFeature(getProduct(item.productId).featureHierarchy, '1/COLOR/') }}

-

{{ $t("Size") }} : {{ $filters.getFeature(getProduct(item.productId).featureHierarchy, '1/SIZE/') }}

+

{{ translate("Color") }} : {{ $filters.getFeature(getProduct(item.productId).featureHierarchy, '1/COLOR/') }}

+

{{ translate("Size") }} : {{ $filters.getFeature(getProduct(item.productId).featureHierarchy, '1/SIZE/') }}

- {{ $t ("Available to promise") }} + {{ translate ("Available to promise") }}

{{ getProductStock(item.productId) }}

- {{ $t("Promised date") }} + {{ translate("Promised date") }}

{{ item.promisedDatetime ? $filters.formatUtcDate(item.promisedDatetime, "yyyy-MM-dd'T'HH:mm:ss'Z'") : '-' }}

- {{$t("Select item")}} + {{translate("Select item")}} @@ -145,7 +145,7 @@
- +
@@ -154,16 +154,16 @@ - {{ $t("Release") }} + {{ translate("Release") }} - {{ $t("Release to a warehouse") }} + {{ translate("Release to a warehouse") }} - {{ $t("Edit promise date") }} + {{ translate("Edit promise date") }} - {{ $t("Cancel") }} + {{ translate("Cancel") }} @@ -224,6 +224,7 @@ import { showToast } from '@/utils' import { Plugins } from '@capacitor/core'; import { DxpShopifyImg } from "@hotwax/dxp-components"; import emitter from "@/event-bus"; +import { translate } from "@hotwax/dxp-components"; const { Clipboard } = Plugins; @@ -334,16 +335,16 @@ export default defineComponent({ }, async deselectAlert() { const alert = await alertController.create({ - header: this.$t("Deselect items"), - message: this.$t('Deselect the selected order items', { count: this.selectedItems.length }), + header: translate("Deselect items"), + message: translate('Deselect the selected order items', { count: this.selectedItems.length }), buttons: [ { - text: this.$t("Cancel"), + text: translate("Cancel"), role: 'cancel', cssClass: 'secondary' }, { - text: this.$t("Deselect"), + text: translate("Deselect"), handler: () => { this.deselectSelectedItems(); }, @@ -353,21 +354,21 @@ export default defineComponent({ return alert.present(); }, async releaseAlert() { - const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? this.$t("There is a job already pending.") : this.$t("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + this.$t( + const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? translate("There is a job already pending.") : translate("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + translate( 'preorders will be automatically brokered and assigned for fulfillment.', { count: this.selectedItems.length } ); const alert = await alertController.create({ - header: this.$t("Release orders"), + header: translate("Release orders"), cssClass: "alert-message", message, buttons: [ { - text: this.$t('Cancel'), + text: translate('Cancel'), role: 'cancel', cssClass: 'secondary' }, { - text:this.$t('Release'), + text:translate('Release'), handler: () => { this.releaseItems(); @@ -378,20 +379,20 @@ export default defineComponent({ return alert.present(); }, async cancelAlert() { - const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? this.$t("There is a job already pending.") : this.$t("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + this.$t( + const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? translate("There is a job already pending.") : translate("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + translate( 'preorders will be cancelled. This action cannot be undone.',{ count: this.selectedItems.length } ) const alert = await alertController.create({ - header:this.$t("Cancel orders"), + header:translate("Cancel orders"), message, buttons: [ { - text: this.$t("Don't cancel"), + text: translate("Don't cancel"), role: 'cancel', cssClass: 'secondary' }, { - text: this.$t("Confirm"), + text: translate("Confirm"), handler: () => { this.cancelItems(); }, @@ -464,7 +465,7 @@ export default defineComponent({ await Clipboard.write({ string: text }).then(() => { - showToast(this.$t('Copied', { text })); + showToast(translate('Copied', { text })); }) }, selectSearchBarText(event: any) { @@ -486,6 +487,7 @@ export default defineComponent({ closeCircle, hourglass, close, + translate }; }, }); diff --git a/src/views/product-details.vue b/src/views/product-details.vue index 471f13f6..95a050c9 100644 --- a/src/views/product-details.vue +++ b/src/views/product-details.vue @@ -5,7 +5,7 @@ - {{ $t("Product details") }} + {{ translate("Product details") }} @@ -30,7 +30,7 @@
- {{ $t("Colors") }} + {{ translate("Colors") }} {{ colorFeature }} @@ -38,7 +38,7 @@ - {{ $t("Sizes") }} + {{ translate("Sizes") }} {{ sizeFeature }} @@ -50,28 +50,28 @@
- {{ $t("Ordered after") }} + {{ translate("Ordered after") }} - {{ $t("Ordered before") }} + {{ translate("Ordered before") }} - {{ $t("Promised after") }} + {{ translate("Promised after") }} - {{ $t("Promised before") }} + {{ translate("Promised before") }} @@ -79,24 +79,24 @@ - {{ $t("Loyalty status") }} + {{ translate("Loyalty status") }} - + {{key}} - {{ $t("Only orders without promise date") }} + {{ translate("Only orders without promise date") }}
@@ -105,8 +105,8 @@
- {{ current.totalPreOrders }} {{ $t("pieces preordered") }} - {{ current.list.items.length ? current.list.items.length : 0 }} {{ current.list.items.length > 1 ? $t("variants") : $t("variant") }} + {{ current.totalPreOrders }} {{ translate("pieces preordered") }} + {{ current.list.items.length ? current.list.items.length : 0 }} {{ current.list.items.length > 1 ? translate("variants") : translate("variant") }} @@ -115,7 +115,7 @@
-

{{ $t("There are no preorders for the filters you have applied and variants you have selected.")}}

+

{{ translate("There are no preorders for the filters you have applied and variants you have selected.")}}

@@ -128,19 +128,19 @@

{{ getProduct(item.groupValue).productName }}

-

{{ $t("Color") }}: {{ $filters.getFeature(getProduct(item.groupValue).featureHierarchy, '1/COLOR/') }}

-

{{ $t("Size") }}: {{ $filters.getFeature(getProduct(item.groupValue).featureHierarchy, '1/SIZE/') }}

+

{{ translate("Color") }}: {{ $filters.getFeature(getProduct(item.groupValue).featureHierarchy, '1/COLOR/') }}

+

{{ translate("Size") }}: {{ $filters.getFeature(getProduct(item.groupValue).featureHierarchy, '1/SIZE/') }}

- {{ item.doclist && item.doclist.numFound ? item.doclist.numFound : 0 }} {{ $t("pieces preordered") }} - {{ getProductStock(item.groupValue) }} {{ $t("in stock") }} - {{ getBrokeringCountByProduct(item.groupValue) }} {{ $t("in brokering") }} + {{ item.doclist && item.doclist.numFound ? item.doclist.numFound : 0 }} {{ translate("pieces preordered") }} + {{ getProductStock(item.groupValue) }} {{ translate("in stock") }} + {{ getBrokeringCountByProduct(item.groupValue) }} {{ translate("in brokering") }}
- {{ $t("Pieces") }} + {{ translate("Pieces") }}
@@ -152,13 +152,13 @@ - {{ $t("Release") }} + {{ translate("Release") }} - {{ $t("Release to a warehouse") }} + {{ translate("Release to a warehouse") }} - {{ $t("Cancel") }} + {{ translate("Cancel") }} @@ -217,6 +217,7 @@ import { DxpShopifyImg } from "@hotwax/dxp-components"; import { sizeIndex } from "@/apparel-sorter" import { DateTime } from 'luxon'; import emitter from "@/event-bus"; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "product-details", @@ -343,11 +344,11 @@ export default defineComponent({ }, async infoAlert() { const alert = await alertController.create({ - header: this.$t("How are orders released?"), - message: this.$t( - "Orders are released from oldest to newest. Use the Date filter to identify orders taken before a certain date.")+"

"+ this.$t("The order count in product cards will be updated based on the filters you select.")+"

" + header: translate("How are orders released?"), + message: translate( + "Orders are released from oldest to newest. Use the Date filter to identify orders taken before a certain date.")+"

"+ translate("The order count in product cards will be updated based on the filters you select.")+"

" , - buttons: [this.$t("Dismiss")], + buttons: [translate("Dismiss")], }); return alert.present(); @@ -358,21 +359,21 @@ export default defineComponent({ // When using clear input the value is reset to '' and results to NaN when added without check return selectedVariantsCount ? count + parseInt(selectedVariantsCount) : count; }, 0) - const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? this.$t("There is a job already pending.") : this.$t("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + this.$t( + const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? translate("There is a job already pending.") : translate("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + translate( 'preorders will be automatically brokered and assigned for fulfillment.',{ count: itemCount } ) const alert = await alertController.create({ - header: this.$t("Release orders"), + header: translate("Release orders"), cssClass: "alert-message", message, buttons: [ { - text: this.$t('Cancel'), + text: translate('Cancel'), role: 'cancel', cssClass: 'secondary' }, { - text:this.$t('Release'), + text:translate('Release'), handler: () => { this.releaseItems(); }, @@ -387,20 +388,20 @@ export default defineComponent({ // When using clear input the value is reset to '' and results to NaN when added without check return selectedVariantsCount ? count + parseInt(selectedVariantsCount) : count; }, 0) - const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? this.$t("There is a job already pending.") : this.$t("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + this.$t( + const message = (this.jobTotal > 0 ? (this.jobTotal === 1 ? translate("There is a job already pending.") : translate("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + translate( 'preorders will be cancelled. This action cannot be undone.',{ count: itemCount } ) const alert = await alertController.create({ - header: this.$t("Cancel orders"), + header: translate("Cancel orders"), message, buttons: [ { - text: this.$t("Don't cancel"), + text: translate("Don't cancel"), role: 'cancel', cssClass: 'secondary' }, { - text: this.$t("Confirm"), + text: translate("Confirm"), handler: () => { this.cancelItems(); }, @@ -587,7 +588,8 @@ export default defineComponent({ list, ribbon, refresh, - store + store, + translate }; }, }); diff --git a/src/views/products.vue b/src/views/products.vue index 22636b5c..ecb8ce32 100644 --- a/src/views/products.vue +++ b/src/views/products.vue @@ -5,7 +5,7 @@ - {{ $t("Products") }} + {{ translate("Products") }} @@ -15,14 +15,14 @@ - +
-

{{ $t("No results found")}}

+

{{ translate("No results found")}}

-

{{ $t("Enter a product name, style name, SKU, UPCA or external ID.")}}

+

{{ translate("Enter a product name, style name, SKU, UPCA or external ID.")}}

@@ -35,11 +35,11 @@

{{ getProduct(product.groupValue).productName}}

{{ feature }}: {{ attribute }}

- {{ product.doclist.numFound }} {{ $t("pieces preordered") }} + {{ product.doclist.numFound }} {{ translate("pieces preordered") }}
- +
@@ -73,6 +73,7 @@ import BackgroundJobModal from "./background-job-modal.vue"; import { useStore } from "@/store"; import { mapGetters } from "vuex"; import { DxpShopifyImg } from "@hotwax/dxp-components"; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "settings", @@ -163,6 +164,7 @@ export default defineComponent({ router, store, hourglass, + translate }; }, }); diff --git a/src/views/promise-date-modal.vue b/src/views/promise-date-modal.vue index a51ed4b9..c0c733c4 100644 --- a/src/views/promise-date-modal.vue +++ b/src/views/promise-date-modal.vue @@ -4,17 +4,17 @@ - {{ $t("Edit promise date") }} + {{ translate("Edit promise date") }} -

{{ $t("Select a new promise date for these orders. This new date will be used for allocating inventory and fulfilling these orders.")}}

+

{{ translate("Select a new promise date for these orders. This new date will be used for allocating inventory and fulfilling these orders.")}}

- {{ $t("Promised date") }} - + {{ translate("Promised date") }} + @@ -47,6 +47,7 @@ import { closeOutline, calendar, save} from "ionicons/icons"; import { useStore } from "@/store"; import { DateTime } from 'luxon' import { mapGetters } from "vuex"; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "PromiseDateModal", @@ -66,16 +67,16 @@ export default defineComponent({ }, async saveAlert() { const alert = await alertController.create({ - header: this.$t("Update promise date"), - message: this.$t( + header: translate("Update promise date"), + message: translate( "Are you sure you want to update the promise date for these orders?" ), buttons: [ { - text: this.$t("Cancel"), + text: translate("Cancel"), }, { - text: this.$t("Confirm"), + text: translate("Confirm"), handler: () => { (this.item ? this.updatePromisedDateItem() : this.updatePromiseDateItems()).then(() => { this.closeModal() @@ -123,7 +124,8 @@ export default defineComponent({ closeOutline, calendar, save, - store + store, + translate }; }, components: { diff --git a/src/views/settings.vue b/src/views/settings.vue index 42e01774..fb3256bd 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -5,7 +5,7 @@ - {{ $t("Settings") }} + {{ translate("Settings") }} @@ -24,18 +24,18 @@ {{ userProfile.partyName }} - {{ $t("Logout") }} + {{ translate("Logout") }} - {{ $t("Go to Launchpad") }} + {{ translate("Go to Launchpad") }} - +
-

{{ $t('OMS') }}

+

{{ translate('OMS') }}

@@ -43,17 +43,17 @@ - {{ $t("Product Store") }} + {{ translate("Product Store") }} - {{ $t("Store") }} + {{ translate("Store") }} - {{ $t('A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores sellling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.') }} + {{ translate('A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores sellling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.') }} - {{ $t("Select store") }} + {{ translate("Select store") }} {{ store.storeName }} @@ -68,17 +68,17 @@ - {{ $t('Timezone') }} + {{ translate('Timezone') }} - {{ $t('The timezone you select is used to ensure automations you schedule are always accurate to the time you select.') }} + {{ translate('The timezone you select is used to ensure automations you schedule are always accurate to the time you select.') }} {{ userProfile && userProfile.userTimeZone ? userProfile.userTimeZone : '-' }} - {{ $t("Change") }} + {{ translate("Change") }}
@@ -114,6 +114,7 @@ import { defineComponent } from "vue"; import { mapGetters } from 'vuex' import TimeZoneModal from '@/views/timezone-modal.vue' import Image from '@/components/Image.vue'; +import { translate } from '@hotwax/dxp-components'; export default defineComponent({ name: "settings", @@ -141,7 +142,7 @@ export default defineComponent({ }, setup() { const store = useStore(); - return { store, codeWorkingOutline, timeOutline, globeOutline, personCircleOutline, openOutline, saveOutline } + return { store, codeWorkingOutline, timeOutline, globeOutline, personCircleOutline, openOutline, saveOutline, translate} }, data() { return { diff --git a/src/views/shipping-popover.vue b/src/views/shipping-popover.vue index 09adec76..5911b4e1 100644 --- a/src/views/shipping-popover.vue +++ b/src/views/shipping-popover.vue @@ -2,7 +2,7 @@ SKU - {{ $t("Edit shipping date") }} + {{ translate("Edit shipping date") }} @@ -18,6 +18,7 @@ import { } from '@ionic/vue'; import { defineComponent } from 'vue'; import ShippingModal from '@/views/edit-shipping-modal.vue'; +import { translate } from '@hotwax/dxp-components'; export default defineComponent({ name: 'ShippingPopover', @@ -39,5 +40,10 @@ export default defineComponent({ IonList, IonListHeader, }, + setup(){ + return { + translate, + } + } }); \ No newline at end of file diff --git a/src/views/timezone-modal.vue b/src/views/timezone-modal.vue index 91fd3f41..b0682c25 100644 --- a/src/views/timezone-modal.vue +++ b/src/views/timezone-modal.vue @@ -6,10 +6,10 @@ - {{ $t("Select time zone") }} + {{ translate("Select time zone") }} - + @@ -18,11 +18,11 @@
- {{ $t("Fetching time zones") }} + {{ translate("Fetching time zones") }}
-

{{ $t("No time zone found") }}

+

{{ translate("No time zone found") }}

@@ -71,6 +71,7 @@ import { useStore } from "@/store"; import { UserService } from "@/services/UserService"; import { hasError } from '@/utils' import { DateTime } from 'luxon'; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "TimeZoneModal", @@ -106,16 +107,16 @@ export default defineComponent({ modalController.dismiss({ dismissed: true }); }, async saveAlert() { - const message = this.$t("Are you sure you want to change the time zone to?", { timeZoneId: this.timeZoneId }); + const message = translate("Are you sure you want to change the time zone to?", { timeZoneId: this.timeZoneId }); const alert = await alertController.create({ - header: this.$t("Update time zone"), + header: translate("Update time zone"), message, buttons: [ { - text: this.$t("Cancel"), + text: translate("Cancel"), }, { - text: this.$t("Confirm"), + text: translate("Confirm"), handler: () => { this.setUserTimeZone(); } @@ -165,7 +166,8 @@ export default defineComponent({ return { close, save, - store + store, + translate }; } }); diff --git a/src/views/warehouse-modal.vue b/src/views/warehouse-modal.vue index 83927274..aa26bdb0 100644 --- a/src/views/warehouse-modal.vue +++ b/src/views/warehouse-modal.vue @@ -6,17 +6,17 @@ - {{ $t("Release preorder to a warehouse") }} + {{ translate("Release preorder to a warehouse") }} - +
-

{{ $t("No warehouses found")}}

+

{{ translate("No warehouses found")}}

@@ -65,6 +65,7 @@ import { useStore } from "@/store"; import { ProductService } from '@/services/ProductService' import { mapGetters } from "vuex"; import emitter from "@/event-bus"; +import { translate } from "@hotwax/dxp-components"; export default defineComponent({ name: "WarehouseModal", @@ -89,20 +90,20 @@ export default defineComponent({ modalController.dismiss({ dismissed: true }); }, async saveAlert() { - const message = this.item ? this.$t( + const message = this.item ? translate( 'This item will be released to the warehouse you have selected.' - ) : (this.jobTotal > 0 ? (this.jobTotal === 1 ? this.$t("There is a job already pending.") : this.$t("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + this.$t( + ) : (this.jobTotal > 0 ? (this.jobTotal === 1 ? translate("There is a job already pending.") : translate("There are jobs already pending.", { count: this.jobTotal })) + " " : "") + translate( 'preorder items will be released to the warehouse you have selected.', { count: (this.selectedVariants ? this.variantItems : this.items).length } ); const alert = await alertController.create({ - header: this.$t("Release orders"), + header: translate("Release orders"), message, buttons: [ { - text: this.$t("Cancel"), + text: translate("Cancel"), }, { - text: this.$t("Confirm"), + text: translate("Confirm"), handler: () => { (this.item ? this.releaseItemToWarehouse() : this.releaseItemsToWarehouse()).then(() => { this.closeModal() @@ -215,7 +216,8 @@ export default defineComponent({ return { closeOutline, send, - store + store, + translate }; }, components: { From 393e27a1965937b0275a0c7edb296bf368c416ad Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Tue, 9 Apr 2024 12:58:25 +0530 Subject: [PATCH 3/4] Delete timezone-modal.vue --- src/views/timezone-modal.vue | 171 ----------------------------------- 1 file changed, 171 deletions(-) delete mode 100644 src/views/timezone-modal.vue diff --git a/src/views/timezone-modal.vue b/src/views/timezone-modal.vue deleted file mode 100644 index 0aa91474..00000000 --- a/src/views/timezone-modal.vue +++ /dev/null @@ -1,171 +0,0 @@ - - - \ No newline at end of file From cdfd6a1a60c793cb919d9a0025fe48d21460f864 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Tue, 9 Jul 2024 10:51:07 +0530 Subject: [PATCH 4/4] Removed: remove some unneccesary comments from app.vue(#280) --- src/App.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9ff81687..2869ee0e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,7 +15,6 @@ import { } from "@ionic/vue"; import Menu from '@/components/Menu.vue'; import { defineComponent } from "vue"; -// import { useI18n } from 'vue-i18n' import TaskQueue from './task-queue'; import OfflineHelper from "./offline-helper" import emitter from "@/event-bus" @@ -112,14 +111,11 @@ export default defineComponent({ const store = useStore(); TaskQueue.init(); OfflineHelper.register(); - // const { t, locale } = useI18n(); const router = useRouter(); return { router, TaskQueue, OfflineHelper, - // t, - // locale, store }; },