Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/hpolthof/laravel-translatio…
Browse files Browse the repository at this point in the history
…ns-db
  • Loading branch information
Paul Olthof committed Jun 14, 2015
2 parents 7c9ff38 + f833abf commit 43915b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,21 @@ the textbox loses it's focus, the translation will be saved.
### Turn it off
If you don't want any additional routes forced into your application, you can disable the whole web interface by
changing the ```translation-db.webinterface``` config from ```TRUE``` to ```FALSE```.

## Importing and exporting
To ease the proces of migrating to translations in the database, two commands are available since version 0.3.
### Import
To import all translations out of your current language files, you can use the command:
```
php artisan translation:fetch
```
This will import all available translations in language files into the database.
> To import just some specifics you can also make use of the options ```--locale``` and ```--group```.
### Export
To dump the translations from your database back to your filesystem, use:
```
php artisan translation:dump
```
> The options ```--locale``` and ```--group``` are also available for this command.
> **Caution**: all current files will be **overwritten**, so use with care!
2 changes: 1 addition & 1 deletion src/Console/Commands/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected function write($dump)
foreach($groups as $group => $content) {
$path = $lang_path."/{$locale}";
if(!\File::exists($path)) {
\File::makeDirectory($lang_path, 0755, true);
\File::makeDirectory($path, 0755, true);
}

$file = $path."/{$group}.php";
Expand Down

0 comments on commit 43915b9

Please sign in to comment.