kazupon / vue-i18n

:globe_with_meridians: Internationalization plugin for Vue.js

Home Page:https://kazupon.github.io/vue-i18n/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hyphens in placeholders causing error `Unterminated closing brace` in vue-i18n@9

rs3d opened this issue · comments

commented

Reporting a bug?

Using a placeholder with hyphens in vue-i18n@9.11.1 is causing aerrors

const messages = {
  en: {
    message: {
      "message-with-placeholder-using-hyphens":
        "My message with {placeholder-hyphens}.", 
    },
  },
};
// usage:
 $t("message.message-with-placeholder-using-hyphens", {
   "placeholder-hyphens": 'XXXX'
});

Error

1  |  My message with {placeholder-hyphens}.

Using <i18n-t> is causing breaking component rendering

<i18n-t
      keypath="message.message-with-placeholder-using-hyphens"
      v-if="false"
    >
      <template #placeholder-hyphens>
        {{ $t("message.hello") }}
      </template>
    </i18n-t>

Demo: https://codesandbox.io/p/devbox/vuei18n-hyphen-vxst9x?file=%2Fsrc%2FApp.vue

Expected behavior

Above message-syntax works in vue-i18n@8

Reproduction

https://codesandbox.io/p/devbox/vuei18n-hyphen-vxst9x?file=%2Fsrc%2FApp.vue

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
    Memory: 20.88 GB / 63.68 GB
  Binaries:
    Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.18 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (123.0.2420.81)
    Internet Explorer: 11.0.22621.1

Screenshot

$t error and output
image
image

error
image

Additional context

No response

Validations

commented

Sorry, my bad I picked the wrong repo... closing this and creating a new one here
intlify/vue-i18n-next#1796