Skip to content
This repository was archived by the owner on Jul 16, 2020. It is now read-only.

Commit c45bdee

Browse files
committed
README: fix up vue-i18n instructions
1 parent 4b4332e commit c45bdee

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,34 @@ Then generate the include file with
2828
php artisan vue-i18n:generate
2929
```
3030

31-
For vue 1.0, adjust your vue app with something like:
32-
31+
Assuming you are using a recent version of vue-i18n, adjust your vue app with something like:
3332
```js
3433
import Vue from 'vue';
35-
import VueInternationalization from 'vue-i18n';
34+
import VueInternalization from 'vue-i18n';
3635
import Locales from './vue-i18n-locales.generated.js';
3736

38-
Vue.use(VueInternationalization, {
39-
lang: 'en',
40-
locales: Locales
37+
Vue.use(VueInternalization);
38+
39+
Vue.config.lang = 'en';
40+
41+
Object.keys(Locales).forEach(function (lang) {
42+
Vue.locale(lang, Locales[lang])
4143
});
4244

4345
...
4446
```
4547

46-
For vue 2.0, adjust your vue app with something like:
48+
49+
For older vue-i18n, the initialization looks something like:
50+
4751
```js
4852
import Vue from 'vue';
49-
import VueInternalization from 'vue-i18n';
53+
import VueInternationalization from 'vue-i18n';
5054
import Locales from './vue-i18n-locales.generated.js';
5155

52-
Vue.use(VueInternalization);
53-
54-
Vue.config.lang = 'en';
55-
56-
Object.keys(Locales).forEach(function (lang) {
57-
Vue.locale(lang, Locales[lang])
56+
Vue.use(VueInternationalization, {
57+
lang: 'en',
58+
locales: Locales
5859
});
5960

6061
...

0 commit comments

Comments
 (0)