Change "settings['vue-i18n'].localeDir" to can specify object options. #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes
settings['vue-i18n'].localeDir
to allow object option.fixes #10
The option allows the user to specify the following options in the object:
pattern
(string
) ... A glob for specifying files that store localization messages of project.localeKey
('file' | 'key'
) ... Specifies how to determine the locale for localization messages.-
'file'
... Determine the locale name from the filename. The resource file should only contain messages for that locale. Use this option if you usevue-cli-plugin-i18n
. This option is also used when String option is specified.-
'key'
... Determine the locale name from the root key name of the file contents. The value of that key should only contain messages for that locale. Used when the resource file is in the format given to themessages
option of theVueI18n
constructor option.I considered how to let the user specify the depth of the hierarchy instead of the
localeKey
, but I realized that when I specified the depth of the hierarchy, the locale could not be specified.I thought perhaps the user would either use
vue-cli-plugin
or give it directly to theVueI18n
constructor and use it.So I decided to provide two options,
file
andkey
.The other change was to show in the message of the
no-missing-keys
rule which locale is missing.