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
In order to edit the default template, the views must be published as well. The views will then be placed in `resources/views/vendor/translation-manager`.
Routes are added in the ServiceProvider. You can set the group parameters for the routes in the configuration.
42
45
You can change the prefix or filter/middleware for the routes. If you want full customisation, you can extend the ServiceProvider and override the `map()` function.
43
46
44
47
This example will make the translation manager available at `http://yourdomain.com/translations`
45
48
46
-
If you would like to use auto translation using Google Translate API
49
+
If you would like to use auto translation using Google Translate API, install https://github.com/tanmuhittin/laravel-google-translate
Edit config/laravel_google_translate.php and add your Google Translate API key.
52
-
53
-
```
54
-
php artisan config:cache
55
-
```
56
-
57
-
Now you can use Auto Translation Trait
58
56
59
-
### Laravel >= 5.2
57
+
### Middleware / Auth
60
58
61
59
The configuration file by default only includes the `auth` middleware, but the latests changes in Laravel 5.2 makes it that session variables are only accessible when your route includes the `web` middleware. In order to make this package work on Laravel 5.2, you will have to change the route/middleware setting from the default
62
60
@@ -97,7 +95,9 @@ You can also use the commands below.
97
95
98
96
The import command will search through app/lang and load all strings in the database, so you can easily manage them.
99
97
100
-
$ php artisan translations:import
98
+
```
99
+
php artisan translations:import
100
+
```
101
101
102
102
Translation strings from app/lang/locale.json files will be imported to the __json_ group.
103
103
@@ -110,7 +110,9 @@ The Find command/button will look search for all php/twig files in the app direc
110
110
The found keys will be added to the database, so they can be easily translated.
111
111
This can be done through the webinterface, or via an Artisan command.
112
112
113
-
$ php artisan translations:find
113
+
```
114
+
php artisan translations:find
115
+
```
114
116
115
117
If your project uses translation strings as keys, these will be stored into then __json_ group.
116
118
@@ -120,7 +122,9 @@ The export command will write the contents of the database back to app/lang php
120
122
This will overwrite existing translations and remove all comments, so make sure to backup your data before using.
121
123
Supply the group name to define which groups you want to publish.
122
124
123
-
$ php artisan translations:export <group>
125
+
```
126
+
php artisan translations:export <group>
127
+
```
124
128
125
129
For example, `php artisan translations:export reminders` when you have 2 locales (en/nl), will write to `app/lang/en/reminders.php` and `app/lang/nl/reminders.php`
126
130
@@ -130,14 +134,17 @@ To export translation strings as keys to JSON files , use the `--json` (or `-J`)
130
134
131
135
The clean command will search for all translation that are NULL and delete them, so your interface is a bit cleaner. Note: empty translations are never exported.
132
136
133
-
$ php artisan translations:clean
137
+
```
138
+
php artisan translations:clean
139
+
```
134
140
135
141
### Reset command
136
142
137
143
The reset command simply clears all translation in the database, so you can start fresh (by a new import). Make sure to export your work if needed before doing this.
0 commit comments