nuxt3 icon indicating copy to clipboard operation
nuxt3 copied to clipboard

Interpolations not working on production build

Open itsmnthn opened this issue 3 years ago • 4 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>

itsmnthn avatar Apr 11 '22 19:04 itsmnthn

Is there any update on this?

anburocky3 avatar Apr 20 '22 23:04 anburocky3

Nope

itsmnthn avatar Apr 21 '22 18:04 itsmnthn

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

Eflyax avatar Jul 22 '22 09:07 Eflyax

+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

j-tap avatar Dec 06 '22 08:12 j-tap