intlify / nuxt3

Nuxt 3 Module for vue-i18n-next

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interpolations not working on production build

itsmnthn opened this issue · comments

Interpolations not working on nuxt3 build

Declaration

{
  welcome: 'Welcome {name}!',
  hello: 'Hello',
}

Usage

<script lang="ts" setup>
import { useI18n } from 'vue-i18n'

const { t } = useI18n({ useScope: 'global' })
</script>

<template>
  <div class="p-10">
      {{ t('hello') }}
      <br />
      {{ t('welcome', { name: 'buddy' }) }}
  </div>
</template>

Is there any update on this?

I can't even use symbol "{" or "}" in translated expression.
For:

welcome: 'Welcome {name}!'

I got:
SyntaxError: Unterminated closing brace
en_US.json: Cannot read properties of undefined (reading 'message')

without braces works everything fine 😢


@intlify/nuxt3@^0.2.3
nuxt3/3.0.0

commented

+1
Interpolations not working on nuxt3 for production build
"@intlify/nuxt3": "^0.2.3", "nuxt": "^3.0.0",

UPD:
Solved the problem by doing like in this example: https://github.com/intlify/vue-i18n-next/tree/master/examples/frameworks/nuxt3
I didn't use from @intlify/nuxt3