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

Casing sensitive path (kebab case)

Jeromearsene opened this issue · comments

Module versions

  • vue: 2.6.14
  • vue-i18n: 8.26.1

Reproduction Link

Sorry but it is too complicated to replicated folder structure.

To Reproduce

Steps to reproduce the behavior:

  1. Have a structure like this:
    Capture d’écran 2021-10-14 à 15 15 32

  2. In add-data.json, have this:

{
  "instructions1": "Glissez-Déposez votre fichier ici",
}
  1. Try to use translation like this:
$t('add-data.instructions1')

Expected behavior

Preserve kebab-case and not write in camelCase like this:

$t('addData.instructions1')

It is possible to preserve kebab-case style ?

Thanks

Thank you for your reporting!

The file name of the resource for which the locale messages is defined cannot be used as the key.
The key you specify for $t is the key defined in the locale messages resource imported with JS import syntax (or require in commonjs).

Thanks!