This repository was archived by the owner on Jul 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 2
2
[ ![ Build Status] ( https://travis-ci.org/martinlindhe/laravel-vue-i18n-generator.png?branch=master )] ( https://travis-ci.org/martinlindhe/laravel-vue-i18n-generator )
3
3
4
4
5
- Laravel 5 package that allows you to share your Laravel translations
5
+ Laravel 5 package that allows you to share your [ Laravel localizations ] ( http://laravel.com/docs/5.1/localization )
6
6
with your [ vue] ( http://vuejs.org/ ) front-end, using [ vue-i18n] ( https://github.com/kazupon/vue-i18n ) .
7
7
8
8
@@ -35,6 +35,32 @@ Vue.use(VueInternationalization, {
35
35
...
36
36
```
37
37
38
+ ## Template names
39
+
40
+ This generate adjusts the strings in order to work with vue-i18n's template names,
41
+ making it simple to share also named templates from your Laravel translations.
42
+
43
+ resource/lang/message.php:
44
+ ``` php
45
+ return [
46
+ 'hello' => 'Hello :name',
47
+ ];
48
+ ```
49
+
50
+ Blade template:
51
+ ``` php
52
+ <div class =" message" >
53
+ <p >{{ trans('message.hello', ['name' => 'visitor']) }}</p >
54
+ </div >
55
+ ```
56
+
57
+ Vue template:
58
+ ``` js
59
+ < div class = " message" >
60
+ < p> {{ $t (' message.hello' , { name: " visitor" }) }}< / p>
61
+ < / div>
62
+ ```
63
+
38
64
39
65
## Notice
40
66
You can’t perform that action at this time.
0 commit comments