diff --git a/package-lock.json b/package-lock.json index 3028fa7..4914281 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "0.0.0", "dependencies": { "@picocss/pico": "^2.0.6", - "vue": "^3.5.13" + "vue": "^3.5.13", + "vue-i18n": "^11.0.1" }, "devDependencies": { "@types/node": "^22.10.2", @@ -447,6 +448,50 @@ "node": ">=18" } }, + "node_modules/@intlify/core-base": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-11.0.1.tgz", + "integrity": "sha512-NAmhw1l/llM0HZRpagR/ChJTNymW4ll6/4EDSJML5c8L5Hl/+k6UyF8EIgE6DeHpfheQujkSRngauViHqq6jJQ==", + "license": "MIT", + "dependencies": { + "@intlify/message-compiler": "11.0.1", + "@intlify/shared": "11.0.1" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/message-compiler": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-11.0.1.tgz", + "integrity": "sha512-5RFH8x+Mn3mbjcHXnb6KCXGiczBdiQkWkv99iiA0JpKrNuTAQeW59Pjq/uObMB0eR0shnKYGTkIJxum+DbL3sw==", + "license": "MIT", + "dependencies": { + "@intlify/shared": "11.0.1", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/shared": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-11.0.1.tgz", + "integrity": "sha512-lH164+aDDptHZ3dBDbIhRa1dOPQUp+83iugpc+1upTOWCnwyC1PVis6rSWNMMJ8VQxvtHQB9JMib48K55y0PvQ==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", @@ -823,6 +868,12 @@ "he": "^1.2.0" } }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, "node_modules/@vue/language-core": { "version": "2.1.10", "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.1.10.tgz", @@ -1223,15 +1274,16 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1539,6 +1591,26 @@ } } }, + "node_modules/vue-i18n": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-11.0.1.tgz", + "integrity": "sha512-pWAT8CusK8q9/EpN7V3oxwHwxWm6+Kp2PeTZmRGvdZTkUzMQDpbbmHp0TwQ8xw04XKm23cr6B4GL72y3W8Yekg==", + "license": "MIT", + "dependencies": { + "@intlify/core-base": "11.0.1", + "@intlify/shared": "11.0.1", + "@vue/devtools-api": "^6.5.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-tsc": { "version": "2.1.10", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.1.10.tgz", diff --git a/package.json b/package.json index 3320d39..fb8a398 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ }, "dependencies": { "@picocss/pico": "^2.0.6", - "vue": "^3.5.13" + "vue": "^3.5.13", + "vue-i18n": "^11.0.1" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/src/App.vue b/src/App.vue index 079405e..23787d2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,6 +5,9 @@ import TraitInput from './components/TraitInput.vue'; import StatInput from './components/StatInput.vue'; import { isNumberInput } from './helpers/validation'; import HelpPopup from './components/HelpPopup.vue'; +import { useI18n } from '@/hooks/useI18n'; + +const { t } = useI18n(); const levelUps = [4, 8, 15, 25, 30, 35, 40, 45, 50, 55]; // NoSonar these are given by the game @@ -18,8 +21,14 @@ const traitValues = ref([0]); const addTrait = () => traitValues.value.push(0); const removeTrait = (index: number) => (traitValues.value = traitValues.value.filter((_, idx) => idx !== index)); -const stats = ['Combat', 'Exploration', 'Industrial', 'Trade']; -const statValues = ref(Array.from({ length: stats.length }, () => 0)); +const stats = computed(() => [ + t('translation.combat'), + t('translation.exploration'), + t('translation.industrial'), + t('translation.trade'), +]); + +const statValues = ref(Array.from({ length: stats.value.length }, () => 0)); const expeditionCount = ref(0); const isExpeditionCountValid = computed(() => isNumberInput(expeditionCount.value.toString())); @@ -62,14 +71,14 @@ const progressClassName = computed(() => {