From ee3d1b33643e5b456570e5798ff91bf19d3c079f Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Thu, 7 Sep 2023 18:56:12 +0530 Subject: [PATCH 1/9] Implemented: i18n (#134) --- src/i18n/index.ts | 20 ++++++++++++++++++++ src/index.ts | 21 +++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 src/i18n/index.ts diff --git a/src/i18n/index.ts b/src/i18n/index.ts new file mode 100644 index 0000000..4670d88 --- /dev/null +++ b/src/i18n/index.ts @@ -0,0 +1,20 @@ +declare var process: any; +import { createI18n } from 'vue-i18n' +import { i18nContext } from '../index'; + +const i18n = createI18n({ + locale: process.env.VUE_APP_I18N_LOCALE || 'en', + fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en', + messages: {} +}) + +// TODO Check if this is needed in updated versions +// Currently this method is added to be used in ts files +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/index.ts b/src/index.ts index d6177c7..10d6d08 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +declare var process: any; import { createPinia } from "pinia"; import { useProductIdentificationStore } from "./store/productIdentification"; import { useAuthStore } from "./store/auth"; @@ -5,6 +6,8 @@ import Login from "./components/Login"; import ShopifyImg from "./components/ShopifyImg"; import { goToOms } from "./utils"; import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' +import { translate } from './i18n'; +import { createI18n } from 'vue-i18n' // TODO: handle cases when the store from app or pinia store are not available // creating a pinia store for the plugin @@ -15,18 +18,26 @@ let loginContext = {} as any let shopifyImgContext = {} as any let appContext = {} as any let productIdentificationContext = {} as any +let i18nContext = {} as any // executed on app initialization export let dxpComponents = { install(app: any, options: any) { appContext = app - + i18nContext.localeMessages = options.localeMessages; // registering pinia in the app app.use(pinia); - + app.use(createI18n({ + locale: process.env.VUE_APP_I18N_LOCALE || 'en', + fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en', + messages: options.localeMessages + })); + app.component('Login', Login) app.component('ShopifyImg', ShopifyImg) - + + console.log('i18nContext',i18nContext); + loginContext.login = options.login loginContext.logout = options.logout loginContext.loader = options.loader @@ -47,5 +58,7 @@ export { ShopifyImg, goToOms, appContext, - productIdentificationContext + productIdentificationContext, + i18nContext, + translate } From 8ebbd7b504809020c5d32a4048d461aa3770631b Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Fri, 8 Sep 2023 14:39:42 +0530 Subject: [PATCH 2/9] Improved: created an instance of i18n in index file itself and using it in the app (#134) --- src/i18n/index.ts | 20 -------------------- src/index.ts | 32 +++++++++++++++++--------------- 2 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 src/i18n/index.ts diff --git a/src/i18n/index.ts b/src/i18n/index.ts deleted file mode 100644 index 4670d88..0000000 --- a/src/i18n/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -declare var process: any; -import { createI18n } from 'vue-i18n' -import { i18nContext } from '../index'; - -const i18n = createI18n({ - locale: process.env.VUE_APP_I18N_LOCALE || 'en', - fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en', - messages: {} -}) - -// TODO Check if this is needed in updated versions -// Currently this method is added to be used in ts files -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/index.ts b/src/index.ts index 10d6d08..18dc48f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ declare var process: any; + import { createPinia } from "pinia"; import { useProductIdentificationStore } from "./store/productIdentification"; import { useAuthStore } from "./store/auth"; @@ -6,7 +7,6 @@ import Login from "./components/Login"; import ShopifyImg from "./components/ShopifyImg"; import { goToOms } from "./utils"; import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' -import { translate } from './i18n'; import { createI18n } from 'vue-i18n' // TODO: handle cases when the store from app or pinia store are not available @@ -14,30 +14,33 @@ import { createI18n } from 'vue-i18n' const pinia = createPinia(); pinia.use(piniaPluginPersistedstate) +let i18n: any +let translate: any; let loginContext = {} as any let shopifyImgContext = {} as any let appContext = {} as any let productIdentificationContext = {} as any -let i18nContext = {} as any // executed on app initialization export let dxpComponents = { install(app: any, options: any) { appContext = app - i18nContext.localeMessages = options.localeMessages; - // registering pinia in the app - app.use(pinia); - app.use(createI18n({ + + // Creating an instance of the i18n and translate function for translating text + i18n = createI18n({ locale: process.env.VUE_APP_I18N_LOCALE || 'en', fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en', messages: options.localeMessages - })); + }) + translate = (key: string) => key ? i18n.global.t(key) : ''; + + // registering pinia in the app + app.use(pinia); + app.use(i18n); app.component('Login', Login) app.component('ShopifyImg', ShopifyImg) - console.log('i18nContext',i18nContext); - loginContext.login = options.login loginContext.logout = options.logout loginContext.loader = options.loader @@ -50,15 +53,14 @@ export let dxpComponents = { } export { - useProductIdentificationStore, - useAuthStore, + appContext, + goToOms, Login, loginContext, + productIdentificationContext, + useProductIdentificationStore, + useAuthStore, shopifyImgContext, ShopifyImg, - goToOms, - appContext, - productIdentificationContext, - i18nContext, translate } From 464460482291e39803d330d95cf9182809c48cbe Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Fri, 8 Sep 2023 14:45:28 +0530 Subject: [PATCH 3/9] Implemented: added vue-i18n: ~9.1.6 entry in package.json (#134) --- package-lock.json | 271 ++++++++++++++++++++++++++++++++++++++-------- package.json | 3 +- 2 files changed, 230 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 82f17ef..d6de261 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,8 @@ "luxon": "^3.3.0", "pinia": "2.0.36", "pinia-plugin-persistedstate": "^3.1.0", - "vue": "^3.3.4" + "vue": "^3.3.4", + "vue-i18n": "~9.1.6" }, "devDependencies": { "@babel/types": "^7.22.11", @@ -61,9 +62,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.15.tgz", - "integrity": "sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA==", + "version": "7.22.16", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", + "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -540,6 +541,88 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "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/@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/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/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/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-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/@ionic/core": { "version": "6.7.5", "resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.7.5.tgz", @@ -991,9 +1074,9 @@ } }, "node_modules/@vue/language-core": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.8.tgz", - "integrity": "sha512-i4KMTuPazf48yMdYoebTkgSOJdFraE4pQf0B+FTOFkbB+6hAfjrSou/UmYWRsWyZV6r4Rc6DDZdI39CJwL0rWw==", + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.10.tgz", + "integrity": "sha512-db8PtM4ZZr7SYNH30XpKxUYnUBYaTvcuJ4c2whKK04fuAjbtjAIZ2al5GzGEfUlesmvkpgdbiSviRXUxgD9Omw==", "dev": true, "dependencies": { "@volar/language-core": "~1.10.0", @@ -1109,13 +1192,13 @@ } }, "node_modules/@vue/typescript": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.8.tgz", - "integrity": "sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==", + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.10.tgz", + "integrity": "sha512-vPSpTXMk4chYwvyTGjM891cKgnx2r6vtbdANOp2mRU31f4HYGyLrZBlGgiua7SaO2cLjUg8y91OipJe0t8OFhA==", "dev": true, "dependencies": { "@volar/typescript": "~1.10.0", - "@vue/language-core": "1.8.8" + "@vue/language-core": "1.8.10" } }, "node_modules/acorn": { @@ -2479,9 +2562,9 @@ } }, "node_modules/luxon": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.2.tgz", - "integrity": "sha512-uBoAVCVcajsrqy3pv7eo5jEUz1oeLmCcnMv8n4AJpT5hbpN9lUssAXibNElpbLce3Mhm9dyBzwYLs9zctM/0tA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.3.tgz", + "integrity": "sha512-tFWBiv3h7z+T/tDaoxA8rqTxy1CHV6gHS//QdaH4pulbq/JuBSGgQspQQqcgnwdAx6pNI7cmvz5Sv/addzHmUg==", "engines": { "node": ">=12" } @@ -3119,9 +3202,9 @@ } }, "node_modules/rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.0.tgz", + "integrity": "sha512-nszM8DINnx1vSS+TpbWKMkxem0CDWk3cSit/WWCBVs9/JZ1I/XLwOsiUglYuYReaeWWSsW9kge5zE5NZtf/a4w==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -3342,6 +3425,14 @@ "node": ">=8" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -3665,6 +3756,23 @@ "node": ">=4.0" } }, + "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-template-compiler": { "version": "2.7.14", "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", @@ -3676,13 +3784,13 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.8.tgz", - "integrity": "sha512-bSydNFQsF7AMvwWsRXD7cBIXaNs/KSjvzWLymq/UtKE36697sboX4EccSHFVxvgdBlI1frYPc/VMKJNB7DFeDQ==", + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.10.tgz", + "integrity": "sha512-ptpTFFDoHQgkWJF7i5iERxooiQzOGtG1uKTfmAUuS3qPuSQGq+Ky/S8BFHhnFGwoOxq/PjmGN2QSZEfg1rtzQA==", "dev": true, "dependencies": { - "@vue/language-core": "1.8.8", - "@vue/typescript": "1.8.8", + "@vue/language-core": "1.8.10", + "@vue/typescript": "1.8.10", "semver": "^7.3.8" }, "bin": { @@ -3761,9 +3869,9 @@ "dev": true }, "@babel/parser": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.15.tgz", - "integrity": "sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA==" + "version": "7.22.16", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", + "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==" }, "@babel/types": { "version": "7.22.15", @@ -4005,6 +4113,67 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@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==", + "requires": { + "@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" + } + }, + "@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==", + "requires": { + "@intlify/shared": "9.1.10" + } + }, + "@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==", + "requires": { + "@intlify/message-resolver": "9.1.10", + "@intlify/shared": "9.1.10", + "source-map": "0.6.1" + } + }, + "@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==" + }, + "@intlify/runtime": { + "version": "9.1.10", + "resolved": "https://registry.npmjs.org/@intlify/runtime/-/runtime-9.1.10.tgz", + "integrity": "sha512-7QsuByNzpe3Gfmhwq6hzgXcMPpxz8Zxb/XFI6s9lQdPLPe5Lgw4U1ovRPZTOs6Y2hwitR3j/HD8BJNGWpJnOFA==", + "requires": { + "@intlify/message-compiler": "9.1.10", + "@intlify/message-resolver": "9.1.10", + "@intlify/shared": "9.1.10" + } + }, + "@intlify/shared": { + "version": "9.1.10", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.1.10.tgz", + "integrity": "sha512-Om54xJeo1Vw+K1+wHYyXngE8cAbrxZHpWjYzMR9wCkqbhGtRV5VLhVc214Ze2YatPrWlS2WSMOWXR8JktX/IgA==" + }, + "@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==", + "requires": { + "@intlify/message-resolver": "9.1.10", + "@intlify/runtime": "9.1.10", + "@intlify/shared": "9.1.10" + } + }, "@ionic/core": { "version": "6.7.5", "resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.7.5.tgz", @@ -4319,9 +4488,9 @@ } }, "@vue/language-core": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.8.tgz", - "integrity": "sha512-i4KMTuPazf48yMdYoebTkgSOJdFraE4pQf0B+FTOFkbB+6hAfjrSou/UmYWRsWyZV6r4Rc6DDZdI39CJwL0rWw==", + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.10.tgz", + "integrity": "sha512-db8PtM4ZZr7SYNH30XpKxUYnUBYaTvcuJ4c2whKK04fuAjbtjAIZ2al5GzGEfUlesmvkpgdbiSviRXUxgD9Omw==", "dev": true, "requires": { "@volar/language-core": "~1.10.0", @@ -4415,13 +4584,13 @@ "requires": {} }, "@vue/typescript": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.8.tgz", - "integrity": "sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==", + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.10.tgz", + "integrity": "sha512-vPSpTXMk4chYwvyTGjM891cKgnx2r6vtbdANOp2mRU31f4HYGyLrZBlGgiua7SaO2cLjUg8y91OipJe0t8OFhA==", "dev": true, "requires": { "@volar/typescript": "~1.10.0", - "@vue/language-core": "1.8.8" + "@vue/language-core": "1.8.10" } }, "acorn": { @@ -5406,9 +5575,9 @@ } }, "luxon": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.2.tgz", - "integrity": "sha512-uBoAVCVcajsrqy3pv7eo5jEUz1oeLmCcnMv8n4AJpT5hbpN9lUssAXibNElpbLce3Mhm9dyBzwYLs9zctM/0tA==" + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.3.tgz", + "integrity": "sha512-tFWBiv3h7z+T/tDaoxA8rqTxy1CHV6gHS//QdaH4pulbq/JuBSGgQspQQqcgnwdAx6pNI7cmvz5Sv/addzHmUg==" }, "magic-string": { "version": "0.30.3", @@ -5817,9 +5986,9 @@ } }, "rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.0.tgz", + "integrity": "sha512-nszM8DINnx1vSS+TpbWKMkxem0CDWk3cSit/WWCBVs9/JZ1I/XLwOsiUglYuYReaeWWSsW9kge5zE5NZtf/a4w==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -5963,6 +6132,11 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -6162,6 +6336,17 @@ } } }, + "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==", + "requires": { + "@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" + } + }, "vue-template-compiler": { "version": "2.7.14", "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", @@ -6173,13 +6358,13 @@ } }, "vue-tsc": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.8.tgz", - "integrity": "sha512-bSydNFQsF7AMvwWsRXD7cBIXaNs/KSjvzWLymq/UtKE36697sboX4EccSHFVxvgdBlI1frYPc/VMKJNB7DFeDQ==", + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.10.tgz", + "integrity": "sha512-ptpTFFDoHQgkWJF7i5iERxooiQzOGtG1uKTfmAUuS3qPuSQGq+Ky/S8BFHhnFGwoOxq/PjmGN2QSZEfg1rtzQA==", "dev": true, "requires": { - "@vue/language-core": "1.8.8", - "@vue/typescript": "1.8.8", + "@vue/language-core": "1.8.10", + "@vue/typescript": "1.8.10", "semver": "^7.3.8" } }, diff --git a/package.json b/package.json index 3398184..7e4114a 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "luxon": "^3.3.0", "pinia": "2.0.36", "pinia-plugin-persistedstate": "^3.1.0", - "vue": "^3.3.4" + "vue": "^3.3.4", + "vue-i18n": "~9.1.6" }, "devDependencies": { "@babel/types": "^7.22.11", From 20803d0b22d88d00ff6bddc716b4754e64a04789 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Fri, 8 Sep 2023 14:49:05 +0530 Subject: [PATCH 4/9] Improved: indentation (#134) --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 18dc48f..c484337 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,10 +37,10 @@ export let dxpComponents = { // registering pinia in the app app.use(pinia); app.use(i18n); - + app.component('Login', Login) app.component('ShopifyImg', ShopifyImg) - + loginContext.login = options.login loginContext.logout = options.logout loginContext.loader = options.loader From 9201c60bbc26a9e18115f3e35d875a3c2242f525 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Tue, 12 Sep 2023 11:09:58 +0530 Subject: [PATCH 5/9] Improved: shifted from vue-i18n version 9.1.6 to 9.2.2 (#134) --- package-lock.json | 180 ++++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 69 insertions(+), 113 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2764211..6812f3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "pinia": "2.0.36", "pinia-plugin-persistedstate": "^3.1.0", "vue": "^3.3.4", - "vue-i18n": "~9.1.6" + "vue-i18n": "^9.2.2" }, "devDependencies": { "@babel/types": "^7.22.11", @@ -542,85 +542,60 @@ "dev": true }, "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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.2.2.tgz", + "integrity": "sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==", "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" + "@intlify/devtools-if": "9.2.2", + "@intlify/message-compiler": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2" }, "engines": { - "node": ">= 10" + "node": ">= 14" } }, "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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/devtools-if/-/devtools-if-9.2.2.tgz", + "integrity": "sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==", "dependencies": { - "@intlify/shared": "9.1.10" + "@intlify/shared": "9.2.2" }, "engines": { - "node": ">= 10" + "node": ">= 14" } }, "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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.2.2.tgz", + "integrity": "sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==", "dependencies": { - "@intlify/message-resolver": "9.1.10", - "@intlify/shared": "9.1.10", + "@intlify/shared": "9.2.2", "source-map": "0.6.1" }, "engines": { - "node": ">= 10" - } - }, - "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": ">= 14" } }, "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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.2.2.tgz", + "integrity": "sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==", "engines": { - "node": ">= 10" + "node": ">= 14" } }, "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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/vue-devtools/-/vue-devtools-9.2.2.tgz", + "integrity": "sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==", "dependencies": { - "@intlify/message-resolver": "9.1.10", - "@intlify/runtime": "9.1.10", - "@intlify/shared": "9.1.10" + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2" }, "engines": { - "node": ">= 10" + "node": ">= 14" } }, "node_modules/@ionic/core": { @@ -3757,17 +3732,17 @@ } }, "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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.2.2.tgz", + "integrity": "sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ==", "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" + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2", + "@vue/devtools-api": "^6.2.1" }, "engines": { - "node": ">= 10" + "node": ">= 14" }, "peerDependencies": { "vue": "^3.0.0" @@ -4114,64 +4089,45 @@ "dev": true }, "@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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.2.2.tgz", + "integrity": "sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==", "requires": { - "@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" + "@intlify/devtools-if": "9.2.2", + "@intlify/message-compiler": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2" } }, "@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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/devtools-if/-/devtools-if-9.2.2.tgz", + "integrity": "sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==", "requires": { - "@intlify/shared": "9.1.10" + "@intlify/shared": "9.2.2" } }, "@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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.2.2.tgz", + "integrity": "sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==", "requires": { - "@intlify/message-resolver": "9.1.10", - "@intlify/shared": "9.1.10", + "@intlify/shared": "9.2.2", "source-map": "0.6.1" } }, - "@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==" - }, - "@intlify/runtime": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/runtime/-/runtime-9.1.10.tgz", - "integrity": "sha512-7QsuByNzpe3Gfmhwq6hzgXcMPpxz8Zxb/XFI6s9lQdPLPe5Lgw4U1ovRPZTOs6Y2hwitR3j/HD8BJNGWpJnOFA==", - "requires": { - "@intlify/message-compiler": "9.1.10", - "@intlify/message-resolver": "9.1.10", - "@intlify/shared": "9.1.10" - } - }, "@intlify/shared": { - "version": "9.1.10", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.1.10.tgz", - "integrity": "sha512-Om54xJeo1Vw+K1+wHYyXngE8cAbrxZHpWjYzMR9wCkqbhGtRV5VLhVc214Ze2YatPrWlS2WSMOWXR8JktX/IgA==" + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.2.2.tgz", + "integrity": "sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==" }, "@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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/vue-devtools/-/vue-devtools-9.2.2.tgz", + "integrity": "sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==", "requires": { - "@intlify/message-resolver": "9.1.10", - "@intlify/runtime": "9.1.10", - "@intlify/shared": "9.1.10" + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2" } }, "@ionic/core": { @@ -6337,14 +6293,14 @@ } }, "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==", - "requires": { - "@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" + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.2.2.tgz", + "integrity": "sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ==", + "requires": { + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2", + "@vue/devtools-api": "^6.2.1" } }, "vue-template-compiler": { diff --git a/package.json b/package.json index a3d50c9..6f1a721 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "pinia": "2.0.36", "pinia-plugin-persistedstate": "^3.1.0", "vue": "^3.3.4", - "vue-i18n": "~9.1.6" + "vue-i18n": "^9.2.2" }, "devDependencies": { "@babel/types": "^7.22.11", From 5d4ee9d961a4f821baeabe11734382b8b19428ae Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Fri, 15 Sep 2023 16:00:44 +0530 Subject: [PATCH 6/9] Implemented: language switcher for centralized use (#141) --- src/components/LanguageSwitcher.vue | 33 +++++++++++++++++++++++++++++ src/components/index.ts | 3 +++ src/index.ts | 3 +++ 3 files changed, 39 insertions(+) create mode 100644 src/components/LanguageSwitcher.vue diff --git a/src/components/LanguageSwitcher.vue b/src/components/LanguageSwitcher.vue new file mode 100644 index 0000000..a4a706c --- /dev/null +++ b/src/components/LanguageSwitcher.vue @@ -0,0 +1,33 @@ + + + \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 0879373..57e0363 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -14,3 +14,6 @@ import '@ionic/vue/css/text-transformation.css'; import '@ionic/vue/css/flex-utils.css'; import '@ionic/vue/css/display.css'; +import LanguageSwitcher from './LanguageSwitcher.vue'; + +export { LanguageSwitcher }; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 675f120..96b5f5b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ declare var process: any; import { createPinia } from "pinia"; import { useProductIdentificationStore } from "./store/productIdentification"; import { useAuthStore } from "./store/auth"; +import { LanguageSwitcher } from "./components"; import Login from "./components/Login"; import ShopifyImg from "./components/ShopifyImg"; import { goToOms } from "./utils"; @@ -38,6 +39,7 @@ export let dxpComponents = { app.use(pinia); app.use(i18n); + app.component('LanguageSwitcher', LanguageSwitcher) app.component('Login', Login) app.component('ShopifyImg', ShopifyImg) @@ -57,6 +59,7 @@ export let dxpComponents = { export { appContext, goToOms, + i18n, Login, loginContext, productIdentificationContext, From cfd06e9610602993c6425e6c806acae3650d2297 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Tue, 19 Sep 2023 15:12:48 +0530 Subject: [PATCH 7/9] Implemented: support for using i18n through dxp and defined a user store for storing the selected locale(#141) --- src/components/LanguageSwitcher.vue | 26 +++++++++++++------------- src/index.ts | 8 +++++++- src/store/user.ts | 24 ++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 src/store/user.ts diff --git a/src/components/LanguageSwitcher.vue b/src/components/LanguageSwitcher.vue index a4a706c..3154e6e 100644 --- a/src/components/LanguageSwitcher.vue +++ b/src/components/LanguageSwitcher.vue @@ -1,16 +1,16 @@