You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/started.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,13 +35,28 @@ module.export = {
35
35
settings: {
36
36
'vue-i18n': {
37
37
localeDir:'./path/to/locales/*.json'// extention is glob formatting!
38
+
// or
39
+
// localeDir: {
40
+
// pattern: './path/to/locales/*.json', // extention is glob formatting!
41
+
// localeKey: 'file' // or 'key'
42
+
// }
38
43
}
39
44
}
40
45
}
41
46
```
42
47
43
48
See [the rule list](../rules/)
44
49
50
+
### `settings['vue-i18n']`
51
+
52
+
-`localeDir` ... You can specify a string or an object.
53
+
- String option ... A glob for specifying files that store localization messages of project.
54
+
- Object option
55
+
-`pattern` (`string`) ... A glob for specifying files that store localization messages of project.
56
+
-`localeKey` (`'file' | 'key'`) ... Specifies how to determine the locale for localization messages.
57
+
-`'file'` ... Determine the locale name from the filename. The resource file should only contain messages for that locale. Use this option if you use `vue-cli-plugin-i18n`. This option is also used when String option is specified.
58
+
-`'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 the `messages` option of the `VueI18n` constructor option.
59
+
45
60
### Running ESLint from command line
46
61
47
62
If you want to run `eslint` from command line, make sure you include the `.vue` and `.json` extension using [the `--ext` option](https://eslint.org/docs/user-guide/configuring#specifying-file-extensions-to-lint) or a glob pattern because ESLint targets only `.js` files by default.
* How to determine the locale for localization messages.
16
+
* - `'file'` ... Determine the locale name from the filename. The resource file should only contain messages for that locale.
17
+
* Use this option if you use `vue-cli-plugin-i18n`. This method is also used when String option is specified.
18
+
* - `'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.
19
+
* Used when the resource file is in the format given to the `messages` option of the `VueI18n` constructor option.
0 commit comments