intlify / bundle-tools

bundling for intlify i18n tools
MIT License
232 stars 37 forks source link

Improper parsing of linked messages with `-` after 0.12 #291

Closed Basaingeal closed 10 months ago

Basaingeal commented 10 months ago

Reporting a bug?

Since v0.12, linked messages, where the path has a hyphen in it, end parsing the path at the hyphen. This results in a blank string, plus the hyphenated bit of the path, or matches a path found without the hyphen.

Expected behavior

{
  "my-message": "'Hello world",
  "my-linked-message": "@:my-message"
}

t('my-linked-message') should result in Hello world.

Instead, it results in -message.

If "my": "Test String" existed, it would result in Test String-message

Reproduction

https://stackblitz.com/edit/github-yae1bq?file=src%2Flocales%2Fen.yml

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz
    Memory: 21.54 GB / 63.73 GB
  Binaries:
    Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.6.12 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (116.0.1938.54)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vite: ^4.0.1 => 4.4.9
    vue: ^3.3.2 => 3.3.4
    vue-i18n: ^9.3.0 => 9.3.0

Screenshot

No response

Additional context

No response

Validations

bandradejs commented 10 months ago

Same here... Rollbacked vue-i18n to 9.2.2 and @intlify/unplugin-vue-i18n to 0.12.3 to make it work...

kazupon commented 10 months ago

close, this issue was fixed at vue-i18n thanks!