Tell us about your environment
- ESLint version: 8.4.1
- eslint-plugin-vue version: 7.19.1
- eslint-plugin-vue-i18n version: 2.0.0
- Node version: 16.16.0
The problem you want to solve.
Localization messages are divided into files. I'm trying to set up a plugin to take the filename as the parent of the messages in the file. For example, we have files common.json validation.json etc.
In app we use key common.messageKey and validation.messageKey.
But as far as I understand, there is no setting for this in plugin.
Your take on the correct solution to problem.
localeDir: {
pattern: '...',
localePattern: /^.+\/(?<locale>[A-Za-z]+)\/.+\.(json5?|ya?ml)$/,
localeKey: 'path',
useFilenameAsGroupKey: true // For example
}
Additional context
A very strange situation when I pass localePattern as a regular expression, for some reason it is not applied and the default regular expression is used, if i pass a string, then everything is OK
Tell us about your environment
The problem you want to solve.
Localization messages are divided into files. I'm trying to set up a plugin to take the filename as the parent of the messages in the file. For example, we have files
common.json validation.jsonetc.In app we use key
common.messageKeyandvalidation.messageKey.But as far as I understand, there is no setting for this in plugin.
Your take on the correct solution to problem.
Additional context
A very strange situation when I pass
localePatternas a regular expression, for some reason it is not applied and the default regular expression is used, if i pass a string, then everything is OK