diff --git a/src/web/package-lock.json b/src/web/package-lock.json index e00dc02..55f2242 100644 --- a/src/web/package-lock.json +++ b/src/web/package-lock.json @@ -13,6 +13,7 @@ "glob-parent": ">=5.1.2", "leaflet-control-geocoder": "2.4.0", "vue": "2.6.14", + "vue-i18n": "^8.26.3", "vue-matomo": "4.2.0", "vue-router": "3.5.3", "vue2-leaflet": "2.7.1", @@ -30,6 +31,7 @@ "eslint": "8.21.0", "eslint-plugin-prettier": "4.0.0", "eslint-plugin-vue": "9.3.0", + "vue-cli-plugin-i18n": "~2.3.2", "vue-template-compiler": "2.6.14" } }, @@ -2157,9 +2159,9 @@ } }, "node_modules/@types/geojson": { - "version": "7946.0.10", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", - "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==", + "version": "7946.0.11", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz", + "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==", "peer": true }, "node_modules/@types/html-minifier-terser": { @@ -2183,9 +2185,9 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==" }, "node_modules/@types/leaflet": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.1.tgz", - "integrity": "sha512-lYawM3I3lLO6rmBASaqdGgY6zUL4YHr3H79/axx7FNYyPXuj0P1DZHbkNo8Itbv0i7Y9EryLWtDXXROMygXhRA==", + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.6.tgz", + "integrity": "sha512-HakGTK5LBBWegNWsAmTlG55zN1zszYec7aG47/z6SzT90bW2vqjmbqk3YKAbrtveO+G7fSTKTYqVbIwAFnTrbg==", "peer": true, "dependencies": { "@types/geojson": "*" @@ -4950,6 +4952,28 @@ "tslib": "^2.0.3" } }, + "node_modules/dot-object": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.4.tgz", + "integrity": "sha512-7FXnyyCLFawNYJ+NhkqyP9Wd2yzuo+7n9pGiYpkmXCTYa8Ci2U0eUNDVg5OuO5Pm6aFXI2SWN8/N/w7SJWu1WA==", + "dev": true, + "dependencies": { + "commander": "^4.0.0", + "glob": "^7.1.5" + }, + "bin": { + "dot-object": "bin/dot-object" + } + }, + "node_modules/dot-object/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", @@ -5439,6 +5463,19 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -5820,6 +5857,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -6590,6 +6636,15 @@ "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-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -6800,9 +6855,9 @@ } }, "node_modules/leaflet": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.3.tgz", - "integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ==", + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", + "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", "peer": true }, "node_modules/leaflet-control-geocoder": { @@ -9529,6 +9584,12 @@ "wbuf": "^1.7.3" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, "node_modules/ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", @@ -10085,6 +10146,43 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz", "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==" }, + "node_modules/vue-cli-plugin-i18n": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-2.3.2.tgz", + "integrity": "sha512-FM2soNhewEt1ebdwRQ4JrX9upSzA+5QJLOHBUcSlMqzfRkVCGVYva28QZ/DeObB+ODklpA/1Dwr+1x3e4xrLew==", + "dev": true, + "dependencies": { + "debug": "^4.3.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" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/vue-cli-plugin-i18n/node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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-eslint-parser": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.1.0.tgz", @@ -10157,6 +10255,58 @@ "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", "dev": true }, + "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==" + }, + "node_modules/vue-i18n-extract": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/vue-i18n-extract/-/vue-i18n-extract-1.2.3.tgz", + "integrity": "sha512-ZLtF6wp732KHKawHx5ZSmjyydkli9g26z0NfGLP89DkiGx4nKFYZ2oIH35HtImdhcfq1zqkeSwxs7kRzarLoVw==", + "dev": true, + "dependencies": { + "commander": "^6.1.0", + "dot-object": "^2.1.4", + "glob": "^7.1.6", + "is-valid-glob": "^1.0.0", + "js-yaml": "^3.14.0" + }, + "bin": { + "vue-i18n-extract": "bin/vue-i18n-extract.js" + } + }, + "node_modules/vue-i18n-extract/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/vue-i18n-extract/node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/vue-i18n-extract/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/vue-loader": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-17.0.1.tgz", @@ -12565,9 +12715,9 @@ } }, "@types/geojson": { - "version": "7946.0.10", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", - "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==", + "version": "7946.0.11", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz", + "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==", "peer": true }, "@types/html-minifier-terser": { @@ -12591,9 +12741,9 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==" }, "@types/leaflet": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.1.tgz", - "integrity": "sha512-lYawM3I3lLO6rmBASaqdGgY6zUL4YHr3H79/axx7FNYyPXuj0P1DZHbkNo8Itbv0i7Y9EryLWtDXXROMygXhRA==", + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.6.tgz", + "integrity": "sha512-HakGTK5LBBWegNWsAmTlG55zN1zszYec7aG47/z6SzT90bW2vqjmbqk3YKAbrtveO+G7fSTKTYqVbIwAFnTrbg==", "peer": true, "requires": { "@types/geojson": "*" @@ -14658,6 +14808,24 @@ "tslib": "^2.0.3" } }, + "dot-object": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.4.tgz", + "integrity": "sha512-7FXnyyCLFawNYJ+NhkqyP9Wd2yzuo+7n9pGiYpkmXCTYa8Ci2U0eUNDVg5OuO5Pm6aFXI2SWN8/N/w7SJWu1WA==", + "dev": true, + "requires": { + "commander": "^4.0.0", + "glob": "^7.1.5" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + } + } + }, "dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", @@ -15018,6 +15186,12 @@ } } }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, "esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -15330,6 +15504,12 @@ "path-exists": "^4.0.0" } }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -15880,6 +16060,12 @@ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, + "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 + }, "is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -16048,9 +16234,9 @@ } }, "leaflet": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.3.tgz", - "integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ==", + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", + "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", "peer": true }, "leaflet-control-geocoder": { @@ -18066,6 +18252,12 @@ "wbuf": "^1.7.3" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, "ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", @@ -18461,6 +18653,36 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz", "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==" }, + "vue-cli-plugin-i18n": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-2.3.2.tgz", + "integrity": "sha512-FM2soNhewEt1ebdwRQ4JrX9upSzA+5QJLOHBUcSlMqzfRkVCGVYva28QZ/DeObB+ODklpA/1Dwr+1x3e4xrLew==", + "dev": true, + "requires": { + "debug": "^4.3.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" + }, + "dependencies": { + "deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true + }, + "dotenv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", + "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", + "dev": true + } + } + }, "vue-eslint-parser": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.1.0.tgz", @@ -18514,6 +18736,51 @@ "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", "dev": true }, + "vue-i18n": { + "version": "8.28.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.28.2.tgz", + "integrity": "sha512-C5GZjs1tYlAqjwymaaCPDjCyGo10ajUphiwA922jKt9n7KPpqR7oM1PCwYzhB/E7+nT3wfdG3oRre5raIT1rKA==" + }, + "vue-i18n-extract": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/vue-i18n-extract/-/vue-i18n-extract-1.2.3.tgz", + "integrity": "sha512-ZLtF6wp732KHKawHx5ZSmjyydkli9g26z0NfGLP89DkiGx4nKFYZ2oIH35HtImdhcfq1zqkeSwxs7kRzarLoVw==", + "dev": true, + "requires": { + "commander": "^6.1.0", + "dot-object": "^2.1.4", + "glob": "^7.1.6", + "is-valid-glob": "^1.0.0", + "js-yaml": "^3.14.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + } + } + }, "vue-loader": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-17.0.1.tgz", diff --git a/src/web/package.json b/src/web/package.json index 815ed1c..66f4e22 100644 --- a/src/web/package.json +++ b/src/web/package.json @@ -7,7 +7,8 @@ "build:web": "vue-cli-service build", "build:docker": "vue-cli-service build --dest ../app/dist/web", "lint": "vue-cli-service lint", - "build": "vue-cli-service build --skip-plugins @vue/cli-plugin-eslint" + "build": "vue-cli-service build --skip-plugins @vue/cli-plugin-eslint", + "i18n:report": "vue-cli-service i18n:report --src \"./src/**/*.?(js|vue)\" --locales \"./src/locales/**/*.json\"" }, "dependencies": { "axios": "0.24.0", @@ -15,6 +16,8 @@ "glob-parent": ">=5.1.2", "leaflet-control-geocoder": "2.4.0", "vue": "2.6.14", + "vue-cookies": "^1.8.3", + "vue-i18n": "^8.26.3", "vue-matomo": "4.2.0", "vue-router": "3.5.3", "vue2-leaflet": "2.7.1", @@ -32,6 +35,7 @@ "eslint": "8.21.0", "eslint-plugin-prettier": "4.0.0", "eslint-plugin-vue": "9.3.0", + "vue-cli-plugin-i18n": "~2.3.2", "vue-template-compiler": "2.6.14" }, "eslintConfig": { diff --git a/src/web/src/App.vue b/src/web/src/App.vue index 2c10b40..2d76803 100644 --- a/src/web/src/App.vue +++ b/src/web/src/App.vue @@ -9,15 +9,21 @@ box-shadow: 1px 3px 3px 0px rgba(163,163,163,0.33) !important; " color="#fff" flat height="77" max-height="77" class="shadow">
- - + + + class="ml-4"> -
-
+ + + {{ locale === 'en' ? 'Français' : 'English' }} +
@@ -46,16 +52,16 @@ box-shadow: 1px 3px 3px 0px rgba(163,163,163,0.33) !important; -
+ @@ -75,6 +81,7 @@ import * as config from "./config"; import { mapState } from "vuex"; import IconLoader from "./components/icons/IconLoader.vue"; import FeedbackForm from "./components/UI/FeedbackForm.vue"; +import { mapGetters, mapActions } from "vuex"; export default { name: "App", @@ -94,6 +101,10 @@ export default { }, watch: {}, methods: { + ...mapActions({ + loadLocale: "setLocale", + changeLocale: "setCookieLocale" + }), changeBackground() { this.noBgImg = false; }, @@ -106,8 +117,30 @@ export default { toggleMenu: function () { this.menuShow = !this.menuShow; }, + toggleLocale: function () { + const currentLocale = this.$cookies.get("locale"); + + const newLocale = currentLocale === "en" ? "fr" : "en"; + + this.$cookies.set("locale", newLocale); + this.loadLocale(newLocale); + this.$i18n.locale = newLocale; + }, + }, + components: { IconLoader, FeedbackForm }, + computed: { + ...mapGetters(["locale"]), + }, + mounted() { + if(this.$cookies.isKey("locale")) { + const locale = this.$cookies.get("locale"); + this.loadLocale(locale); + this.$i18n.locale = locale; + } else { + this.$cookies.set("locale", "en"); + this.$i18n.locale = "en"; + } }, - components: { IconLoader, FeedbackForm } }; @@ -251,6 +284,26 @@ export default { background-color: #EDEDED; } +.links-to div a { + white-space: nowrap; +} + +@media screen and (max-width: 530px) { + .links-to div a { + text-align: center; + } + .links-to { + flex-direction: column; + justify-content: center; + } + .links-to div:nth-child(2) { + display: flex; + justify-content: center; + align-items: center; + padding: 0; + } +} + @media (min-width: 1904px) { .small-container { max-width: 1185px !important; diff --git a/src/web/src/components/Department.vue b/src/web/src/components/Department.vue index 33bdf90..f563e89 100644 --- a/src/web/src/components/Department.vue +++ b/src/web/src/components/Department.vue @@ -11,7 +11,7 @@ @@ -26,30 +26,29 @@
-

{{ title }}

+

{{$t('components.departments_api')[title] ? $t('components.departments_api')[title] : title }}

-

Browse employees by these - divisions

+

{{ $t("components.department.labels.browse_employees_by_divisions") }}

-

There are - no results.

+

{{ $t("components.department.labels.no_results") }}

  • - {{ - parent_item - }} + + {{ ($t('components.divisions_api')[parent_item]) ? $t('components.divisions_api')[parent_item] : parent_item }} +
  • @@ -57,8 +56,7 @@
    View a list of all - Department of {{ title }} + style="font-size: 22px; font-weight: 700;" :class="{ colorOnClick: checkGrid }">{{ $t("components.department.labels.view_list") }} {{ title }}
    @@ -67,24 +65,24 @@
    -

    Group by:

    +

    {{ $t("components.department.labels.group_by") }}

    - See all government employees - Location - Position + {{ $t("components.department.labels.see_all_employees") }} + {{ $t("components.department.labels.location") }} + {{ $t("components.department.labels.position") }}
    -

    There are no results

    +

    {{ $t("components.department.labels.no_results") }}

    -

    {{ divisionLength }} Results

    +

    {{ divisionLength }} {{ $t("components.department.labels.results") }}

    diff --git a/src/web/src/components/EmployeeDetail.vue b/src/web/src/components/EmployeeDetail.vue index 87f0c35..c5290df 100644 --- a/src/web/src/components/EmployeeDetail.vue +++ b/src/web/src/components/EmployeeDetail.vue @@ -7,7 +7,15 @@ @@ -23,46 +31,46 @@ {{ item.formatted_name }}

    - {{ item.title }} + {{$t('components.positions_api')[item.title] ? $t('components.positions_api')[item.title] : item.title }}

    -

    Organization

    +

    {{ $t("components.employee_details.organization.title") }}

    - Department: - {{ - item.department - }} + {{ $t("components.employee_details.organization.department") }} : + + {{$t('components.departments_api')[item.department] ? $t('components.departments_api')[item.department] : item.department }} +

    - Division: {{ item.division }} + {{ $t("components.employee_details.organization.division") }}: {{ ($t('components.divisions_api')[item.division]) ? $t('components.divisions_api')[item.division] : item.division }}

    - Branch: - {{ - item.branch - }} + {{ $t("components.employee_details.organization.branch") }}: + + {{ ($t('components.branch_api')[item.branch]) ? $t('components.branch_api')[item.branch] : item.branch }} +

    - Unit: {{ item.unit }} + {{ $t("components.employee_details.organization.unit") }}: {{ item.unit }}

    -

    Contact:

    +

    {{ $t("components.employee_details.contact.title") }}:

    - Phone office: + {{ $t("components.employee_details.contact.phone_office") }}: {{ item.phone_office }} @@ -70,23 +78,23 @@

    - Email address: + {{ $t("components.employee_details.contact.email_address") }}: {{ item.email }}

    - Fax office: {{ item.fax_office }} + {{ $t("components.employee_details.contact.fax_office") }}: {{ item.fax_office }}

    -

    Position information

    +

    {{ $t("components.employee_details.position_information.title") }}

    - Manager: + {{ $t("components.employee_details.position_information.manager") }}: {{ item.manager }} @@ -95,25 +103,25 @@ -

    Location

    +

    {{ $t("components.employee_details.location.title") }}

    - Address: {{ item.address }} + {{ $t("components.employee_details.location.address") }}: {{ item.address }}

    - Community: {{ item.community }} + {{ $t("components.employee_details.location.community") }}: {{ item.community }}

    - Postal code: {{ item.postal_code }} + {{ $t("components.employee_details.location.postal_code") }}: {{ item.postal_code }}

    - Mail code: {{ item.mailcode }} + {{ $t("components.employee_details.location.mail_code") }}: {{ item.mailcode }}

    - + @@ -212,8 +220,6 @@ export default { this.getUrl(); }, methods: { - - getUrl() { const urlLocation = String(window.location.href); let url = urlLocation.split(window.location.pathname); @@ -251,17 +257,13 @@ export default { return true; } }, - generateUrl(type, param, index) { let url = this.url - let find = " "; - let reg = new RegExp(find, "g"); let department = this.department.replace(reg, "-"); let indexFormatted = index.replace(reg, "-"); let paramFormatted = param.replace(reg, "-"); - if (type === 'manager') { if (this.managerAvailability !== true) { return url + '/employee-not-found/' + param.replace(reg, ".") @@ -375,16 +377,16 @@ export default { const dynamicBreadcrumb = arr.filter(({ dynamic }) => !!dynamic); dynamicBreadcrumb.forEach((element) => { - if (element.name == "Department") { + if (element.name == "breadcrumbs.department") { element.name = this.department; element.link = "/find-employee/" + this.department.replace(reg, "-"); - } else if (element.name == "Division") { + } else if (element.name == "breadcrumbs.division") { element.name = this.division; element.link = ("/find-employee/" + this.department + "/" + this.division) .replace(reg, "-") + "/all-branches"; - } else if (element.name == "Branch") { + } else if (element.name == "breadcrumbs.branch") { if (this.branch === null) { element.name = null; element.link = null; @@ -399,13 +401,12 @@ export default { this.branch ) .replace(reg, "-") - } else if (element.name == "Username") { + } else if (element.name == "breadcrumbs.username") { element.name = this.title; } }); arr = arr.filter((item) => item.name !== null); - this.breadcrumbsList = arr; }, }, diff --git a/src/web/src/components/EmployeeSearch.vue b/src/web/src/components/EmployeeSearch.vue index 781ddf1..aabb11d 100644 --- a/src/web/src/components/EmployeeSearch.vue +++ b/src/web/src/components/EmployeeSearch.vue @@ -7,28 +7,28 @@ -

    Your search for {{ this.searchTitle.replace(/-/g, " ") }} in the department {{this.department}} had no results.

    -

    Your search for {{ this.searchTitle.replace(/-/g, " ") }} has no results.

    -

    Your search for {{ this.searchTitle.replace(/-/g, " ") }} in the department {{this.department}} found {{ this.itemsLength }} results.

    -

    Your search for {{ this.searchTitle.replace(/-/g, " ") }} found {{ this.itemsLength }} results. +

    {{ $t("components.employee_search.no_results_by_department.body.part1") }} {{ this.searchTitle.replace(/-/g, " ") }} {{ $t("components.employee_search.no_results_by_department.body.part2") }} {{$t('components.departments_api')[this.department] ? $t('components.departments_api')[this.department] : this.department }} {{ $t("components.employee_search.no_results_by_department.body.part3") }}

    +

    {{ $t("components.employee_search.no_results.body.part1") }} {{ this.searchTitle.replace(/-/g, " ") }} {{ $t("components.employee_search.no_results.body.part2") }}

    +

    {{ $t("components.employee_search.results_by_department.body.part1") }} {{ this.searchTitle.replace(/-/g, " ") }} {{ $t("components.employee_search.results_by_department.body.part2") }} {{$t('components.departments_api')[this.department] ? $t('components.departments_api')[this.department] : this.department }} {{ $t("components.employee_search.results_by_department.body.part3") }} {{ this.itemsLength }} {{ $t("components.employee_search.results_by_department.body.part4") }}

    +

    {{ $t("components.employee_search.results.body.part1") }} {{ this.searchTitle.replace(/-/g, " ") }} {{ $t("components.employee_search.results.body.part2") }} {{ this.itemsLength }} {{ $t("components.employee_search.results.body.part3") }}

    -

    Group by:

    +

    {{ $t("components.employee_search.labels.group_by") }}:

    - See all government employees - Department - Location - Position + {{ $t("components.employee_search.labels.see_all") }} + {{ $t("components.employee_search.labels.department") }} + {{ $t("components.employee_search.labels.location") }} + {{ $t("components.employee_search.labels.position") }} diff --git a/src/web/src/components/Employees.vue b/src/web/src/components/Employees.vue index e375f3b..902a4f1 100644 --- a/src/web/src/components/Employees.vue +++ b/src/web/src/components/Employees.vue @@ -10,7 +10,7 @@ @@ -20,7 +20,7 @@

    - Browse the employee directory by department + {{ $t("components.employees.browse_directory_by_department") }}

    @@ -40,7 +40,9 @@ - {{ index }} + + {{$t('components.departments_api')[index] ? $t('components.departments_api')[index] : index }} + diff --git a/src/web/src/components/Grid.vue b/src/web/src/components/Grid.vue index 1f12f26..e457964 100644 --- a/src/web/src/components/Grid.vue +++ b/src/web/src/components/Grid.vue @@ -8,22 +8,27 @@ -

    Group by:

    +

    {{ $t("components.grid.group_by") }}:

    - See all government employees - Location - Position + {{ $t("components.grid.see_all") }} + {{ $t("components.grid.location") }} + {{ $t("components.grid.position") }} @@ -37,16 +42,16 @@
    -

    There are no results

    +

    {{ $t("components.grid.no_results") }}

    -

    {{ div }}

    -

    ( {{ divisionLength }} Results )

    +

    {{ ($t('components.divisions_api')[div]) ? $t('components.divisions_api')[div] : div }}

    +

    ( {{ divisionLength }} {{ $t("components.grid.results") }} )

    -

    {{ branch }}

    -

    ( {{ totalLength }} Results )

    +

    {{ ($t('components.branch_api')[branch]) ? $t('components.branch_api')[branch] : branch }}

    +

    ( {{ totalLength }} {{ $t("components.grid.results") }} )

    @@ -209,29 +214,40 @@ export default { var reg = new RegExp(find, 'g'); let arr = this.$route.meta.breadcrumb; const dynamicBreadcrumb = arr.filter(({ dynamic }) => !!dynamic); + dynamicBreadcrumb.forEach((element => { - if (element.name == 'Department') { - element.name = this.department; - element.link = '/find-employee/' + this.department.replace(reg, '-') - } else if (element.name == 'Division') { - if (this.div === 'Not division') { - element.name = 'Employees who are not assigned a division' - element.link = null - } else element.name = this.div; + switch (element.name) { + case 'breadcrumbs.department': + element.name = this.department.trim(); + element.link = '/find-employee/' + this.department.replace(reg, '-') + break; + case 'breadcrumbs.division': + if (this.div === 'Not division') { + element.name = 'Employees who are not assigned a division' + element.link = null + } else{ + element.name = this.div.trim(); + } - if (this.branch !== 'All branches') { - - element.link = ('/find-employee/' + this.department + '/' + this.div).replace(reg, '-') + '/all-branches' - } else { - - element.link = null - } - } else if (element.name == 'Branch') { - if (this.branch === 'All branches') { - element.name = 'Employees who are not assigned a branch' - } else { - element.name = this.branch; - } + if (this.branch !== 'All branches') { + element.link = ('/find-employee/' + this.department + '/' + this.div).replace(reg, '-') + '/all-branches' + } else { + element.link = null + } + break; + case 'breadcrumbs.branch': + switch (this.branch) { + case 'All branches': + element.name = 'All branches' + break; + case 'All branches': + element.name = 'All branches' + break; + default: + element.name = this.iibranch; + break; + } + break; } })) arr = arr.filter(item => item.name !== null) diff --git a/src/web/src/components/UI/DepartmentHeader.vue b/src/web/src/components/UI/DepartmentHeader.vue index d67f1b8..55aece9 100644 --- a/src/web/src/components/UI/DepartmentHeader.vue +++ b/src/web/src/components/UI/DepartmentHeader.vue @@ -9,7 +9,7 @@

    - {{ title }} + {{$t('components.departments_api')[title] ? $t('components.departments_api')[title] : title }}

    diff --git a/src/web/src/components/UI/DivisionsCard.vue b/src/web/src/components/UI/DivisionsCard.vue index fdd3494..e52fb2d 100644 --- a/src/web/src/components/UI/DivisionsCard.vue +++ b/src/web/src/components/UI/DivisionsCard.vue @@ -8,16 +8,18 @@
  • {{ - parent_item - }} + @click="activateBranches(parent_item)" :key="id" class="division"> + {{ ($t('components.divisions_api')[parent_item]) ? $t('components.divisions_api')[parent_item] : parent_item }} +
    • {{ index }} + class="branch my-2 px-0 py-3"> + {{ ($t('components.branch_api')[index]) ? $t('components.branch_api')[index] : index }} +
    @@ -65,7 +67,7 @@ export default { this.check = division }, generateUrl(type, param, index) { - + const urlLocation = String(window.location.href) let url = urlLocation.split(window.location.pathname) @@ -81,30 +83,25 @@ export default { let department = this.department.replace(reg, '-') let indexFormatted = index.replace(reg, '-') let paramFormatted = param.replace(reg, '-') - if (indexFormatted === 'Employees-who-are-not-assigned-a-division') { indexFormatted = 'not-division' } - - if (type === 'division') { - - - if (indexFormatted === 'not-division') { - return url + '/find-employee/' + department + '/not-division/all-branches' - } - return url + '/find-employee/' + department + '/' + indexFormatted + '/all-branches' - - } else if (type === 'branch') { - - if (paramFormatted !== 'Employees-who-are-not-assigned-a-branch' && indexFormatted !== 'not-division') { - - return url + '/find-employee/' + department + '/' + indexFormatted + '/' + paramFormatted - - } else { - + switch (type) { + case 'division': + if (indexFormatted === 'not-division') { + return url + '/find-employee/' + department + '/not-division/all-branches' + } return url + '/find-employee/' + department + '/' + indexFormatted + '/all-branches' - - } + break; + case 'branch': + if (paramFormatted === 'Employees-who-are-not-assigned-a-branch') { + paramFormatted = 'not-branch' + } + return url + '/find-employee/' + department + '/' + indexFormatted + '/' + paramFormatted + break; + default: + return url + '/find-employee/' + department + '/' + indexFormatted + '/all-branches' + break; } }, getDataFromApi() { diff --git a/src/web/src/components/UI/EmployeesGrid.vue b/src/web/src/components/UI/EmployeesGrid.vue index 810c1b3..737da7c 100644 --- a/src/web/src/components/UI/EmployeesGrid.vue +++ b/src/web/src/components/UI/EmployeesGrid.vue @@ -2,7 +2,8 @@