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

Commit 4b4332e

Browse files
committed
README: add vue 2.0 instructions, thanks @gerardreches
1 parent 95768ca commit 4b4332e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ Then generate the include file with
2828
php artisan vue-i18n:generate
2929
```
3030

31-
Adjust your vue app with something like:
31+
For vue 1.0, adjust your vue app with something like:
3232

3333
```js
3434
import Vue from 'vue';
3535
import VueInternationalization from 'vue-i18n';
36-
3736
import Locales from './vue-i18n-locales.generated.js';
3837

3938
Vue.use(VueInternationalization, {
@@ -44,6 +43,24 @@ Vue.use(VueInternationalization, {
4443
...
4544
```
4645

46+
For vue 2.0, adjust your vue app with something like:
47+
```js
48+
import Vue from 'vue';
49+
import VueInternalization from 'vue-i18n';
50+
import Locales from './vue-i18n-locales.generated.js';
51+
52+
Vue.use(VueInternalization);
53+
54+
Vue.config.lang = 'en';
55+
56+
Object.keys(Locales).forEach(function (lang) {
57+
Vue.locale(lang, Locales[lang])
58+
});
59+
60+
...
61+
```
62+
63+
4764
## Parameters
4865

4966
The generator adjusts the strings in order to work with vue-i18n's named formatting,

0 commit comments

Comments
 (0)