Skip to content

Commit e46d6be

Browse files
committed
initial commit
0 parents  commit e46d6be

File tree

6 files changed

+2879
-0
lines changed

6 files changed

+2879
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor
2+
/.idea

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## About
2+
3+
Laravel 5 package that allows you to share your Laravel translations
4+
with your [vue](http://vuejs.org/) front-end, using [vue-i18n](https://github.com/kazupon/vue-i18n).
5+
6+
7+
## Usage
8+
9+
In your project:
10+
```composer require martinlindhe/laravel-vue-i18n-generator```
11+
12+
In ```config/app.php``` providers:
13+
14+
```php
15+
MartinLindhe\VueInternationalizationGenerator\GeneratorProvider::class,
16+
```
17+
18+
Then generate the include file with ```php artisan vue-i18n:generate```
19+
20+
Adjust your vue app with something like:
21+
22+
```js
23+
var Vue = require('vue')
24+
var i18n = require('vue-i18n')
25+
26+
import Locales from './vue-i18n-locales.generated.js';
27+
28+
Vue.use(i18n, {
29+
lang: 'en',
30+
locales: Locales
31+
});
32+
33+
...
34+
```
35+
36+
37+
## Notice
38+
39+
The generated file is an ES6 module.

composer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "martinlindhe/laravel-vue-i18n-generator",
3+
"license": "MIT",
4+
"description": "Generates a vue-i18n compatible include file from your Laravel translations.",
5+
"keywords": ["laravel","vue-i18n"],
6+
"homepage": "http://github.com/martinlindhe/laravel-vue-i18n-generator",
7+
"authors": [
8+
{
9+
"name": "Martin Lindhe",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"require": {
14+
"php": ">=5.4.0",
15+
"laravel/framework": "~5.0"
16+
},
17+
"require-dev": {
18+
"phpunit/phpunit": "~4.7"
19+
},
20+
"autoload": {
21+
"psr-4": {
22+
"MartinLindhe\\VueInternationalizationGenerator\\": "src/"
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)