nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.76k stars 484 forks source link

Per-page translations #3187

Open MickL opened 1 month ago

MickL commented 1 month ago

Describe the feature

Same as #498 from 2019, I guess. The last comment from 2021, asking for a solution has 11 upvotes so I guess there is no solution.

I am having some pages that do not have repeating text and content, e.g. "general terms conditions". This page has a lot of paragraphs with headlines in between and links and the content can be very different per language. It will not be a 1:1 translation.

What I would like to have is a page per translation, e.g.:

- gtc-en.vue
- gtc-de.vue

Or translate it by the usage of a component with a slot-like:

- gtc.vue
  - /i18n/de.vue
  - /i18n/en.vue

Then it could look something like this:

<template>
    <h1>{{ $t('gtc-title')}} </h1>
   <i18n langDir="i18n" />
</template>

Or maybe something else?

Additional information

Final checks

Joshinn-io commented 1 month ago

We are also looking for this solution, was disappointed to see the previous issue from 5 years ago ended up getting closed. Would love to see this revisited! It's not feasible for us to load all languages for every page for sites with lots of languages/content, would be much more efficient if we can get only the necessary ones as per issue #498

MickL commented 1 month ago

I think we can use https://github.com/nuxt-modules/i18n/issues/498#issuecomment-555610691 for now, but I agree this feature is a MUST