From 1b038c78269faf6854426a0b95c71aba65f5ff53 Mon Sep 17 00:00:00 2001 From: Corentin THOMASSET Date: Mon, 19 Jun 2023 23:14:44 +0200 Subject: [PATCH] chore(i18n): tool scoped locales (#471) --- locales/en.yml | 3 +- src/layouts/tool.layout.vue | 9 +++- src/plugins/i18n.plugin.ts | 41 ++----------------- src/tools/token-generator/locales/en.yml | 9 ++++ src/tools/token-generator/locales/fr.yml | 9 ++++ .../token-generator/token-generator.tool.vue | 9 ++-- 6 files changed, 35 insertions(+), 45 deletions(-) create mode 100644 src/tools/token-generator/locales/en.yml create mode 100644 src/tools/token-generator/locales/fr.yml diff --git a/locales/en.yml b/locales/en.yml index 4982dc533..385e019be 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -1,3 +1,4 @@ home: categories: - newestTools: "Newest tools" + newestTools: Newest tools + diff --git a/src/layouts/tool.layout.vue b/src/layouts/tool.layout.vue index bdbb86953..aa808f1cd 100644 --- a/src/layouts/tool.layout.vue +++ b/src/layouts/tool.layout.vue @@ -23,6 +23,11 @@ const head = computed(() => ({ ], })); useHead(head); +const { t } = useI18n(); + +const i18nKey = computed(() => route.path.trim().replace('/', '')); +const toolTitle = computed(() => t(`tools.${i18nKey.value}.title`, String(route.meta.name))); +const toolDescription = computed(() => t(`tools.${i18nKey.value}.description`, String(route.meta.description)));