chore(i18n): tool scoped locales (#471)

This commit is contained in:
Corentin THOMASSET 2023-06-19 23:14:44 +02:00 committed by GitHub
parent ec4c533718
commit 1b038c7826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 45 deletions

View file

@ -23,6 +23,11 @@ const head = computed<HeadObject>(() => ({
],
}));
useHead(head);
const { t } = useI18n();
const i18nKey = computed<string>(() => route.path.trim().replace('/', ''));
const toolTitle = computed<string>(() => t(`tools.${i18nKey.value}.title`, String(route.meta.name)));
const toolDescription = computed<string>(() => t(`tools.${i18nKey.value}.description`, String(route.meta.description)));
</script>
<template>
@ -31,7 +36,7 @@ useHead(head);
<div class="tool-header">
<div flex flex-nowrap items-center justify-between>
<n-h1>
{{ route.meta.name }}
{{ toolTitle }}
</n-h1>
<div>
@ -42,7 +47,7 @@ useHead(head);
<div class="separator" />
<div class="description">
{{ route.meta.description }}
{{ toolDescription }}
</div>
</div>
</div>