adriaroable
i18n ally with Nuxt 3 (VS Code extension)
So I got my app to work with the locales folder with
$t("hello"
) and with single file components (sfc) like so t("cloud")
with const { t } = useI18n({: "local", });
. Now, I discovered the i18n ally VS Code extension and wanted to give it a try, but it's not detecting the translations inside <i18n> blocks for the sfc's. How do I set this up? Thanks in advance.1 replies
Troubles combining nuxt/content and i18n modules
Hello, I find it hard to combine these two modules. I can make them work separately but in the end I find some cases where I cannot move forward and can't find guides on the docs. So, how would the next be structured in the app?
I have
[[ P.S: Would be nice to have a i18n template (ideally includint nuxt/content also) on the Nuxt docs because I think nowadays more and more websites need their pages in multiple languages. ]]
terms. md
and warn.md
documents inside content/legal/
. I call these with <ContentDoc />
inside pages/[...slug].vue
. And I can access them in localhost:300/legal/terms
and localhost:300/legal/warn
. The trouble comes when combining to the i18n module with this pages translations.
1) How would you now translate them into another language?
Do you use another document (.md) for each language or define the locales in the same and how?
2) How would you use NuxtLink in this case?
I tried with the next but I am getting this path: /legal%2Fterms
NuxtLink :to="localePath({ name: 'slug', params: { slug: 'legal/terms' } })" class="mr-4">{{ t("Terms") }}</NuxtLink>
Do I need to move the pages/[...slug].vue
file inside a new pages/legal
folder? What would be the best approach for this?
Thank you in advance just for reading till the end and trying to understand the situation 😅[[ P.S: Would be nice to have a i18n template (ideally includint nuxt/content also) on the Nuxt docs because I think nowadays more and more websites need their pages in multiple languages. ]]
1 replies
Multipurpose button
So I had this working with Nuxt 2 but it broke upgrading to Nuxt 3.
https://thenextbit.de/en/blog/multipurpose-buttons-with-tailwind
The article is already a few years old, and now every <BaseButton> I make becomes a "button" and doesn't look if it has "to" (to become a <NuxtLink> or "href" for <a>.
How can I fix it or is there a workaround?
10 replies