nuxt3 icon indicating copy to clipboard operation
nuxt3 copied to clipboard

Inputs' dynamic attributes are translated in dev and SSR but not in SSG

Open MuhammadM1998 opened this issue 3 years ago • 1 comments

I'm using @intlify/nuxt3 to internationalize a website. I build and deployed the site in ssr: true and target: server (default) and hosted it on vercel and It works good in dev, preview and production.

Now I'm trying to build the app with SSG (ssr: true and target: static) using the following steps:

  • Added target: static to the nuxt.config.ts
  • Runned nuxt generate instead of nuxt build

The complete app is translated correctly in dev upon choosing a locale. However, after running nuxt generate and nuxt preview, the app is almost completely translated except of buttons having dynamic placeholder and aria-label atrributes.

my component snippet:

<form>
  <input
    type="number"
    name="flight-no"
    :aria-label="$t('sections.flight_request.form.flight_no')"
    :placeholder="$t('sections.flight_request.form.flight_no')"
  />

  <input
    type="text"
    name="full-name"
    :aria-label="$t('sections.flight_request.form.full_name')"
    :placeholder="$t('sections.flight_request.form.full_name')"
  />
</form>

The project repo on GitHub: https://github.com/MuhammadM1998/EGSA

MuhammadM1998 avatar Jul 17 '22 08:07 MuhammadM1998

lucky man, translations in my project not work in ssr, ssg i not try

I use "@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge",

max5432112345 avatar Aug 09 '22 05:08 max5432112345