Skip to content

Commit f79a34e

Browse files
committed
exclude_langs configuration option
1 parent b44bf70 commit f79a34e

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

config/translation-manager.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@
4040
*/
4141
'exclude_groups' => array(),
4242

43+
/**
44+
* Exclude specific langs from Laravel Translation Manager.
45+
* This is useful if, for example, you want to avoid editing spare lang files or vendor catalog.
46+
*
47+
* @type array
48+
*
49+
* array(
50+
* 'en',
51+
* 'vendor',
52+
* )
53+
*/
54+
'exclude_langs' => array(
55+
'vendor',
56+
// ...
57+
),
58+
4359
/**
4460
* Export translations with keys output alphabetically.
4561
*/

readme.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Configuration
9494
| route | Route declaration (prefix, namespace, middlewares etc.) | [,'prefix' => 'translations', 'namespace' => 'HighSolutions\TranslationManager', 'middleware' => [,'web', 'auth',],] |
9595
| delete_enabled | Enable deletion of translations | true |
9696
| exclude_groups | Exclude specific file groups (like validation, pagination, routes etc.) | [] |
97+
| exclude_langs | Exclude specific langs and directories (like vendor and en, etc.) | [] |
9798
| sort_keys | Export translations with keys output alphabetically. | false |
9899
| highlight_locale_marked | Highlight lines with locale marked as not translated. | false |
99100
| live_translation_enabled | Enable live translation of content. | false |
@@ -262,6 +263,14 @@ Do not use this inside of non-clickable elements (title attribute, alt attribute
262263
Changelog
263264
---------
264265

266+
0.3.7
267+
268+
* New configuration option to exclude langs
269+
270+
0.3.6
271+
272+
* Support auto-discovery and Laravel 5.5
273+
265274
0.3.0
266275

267276
* Support for subdirectories
@@ -288,4 +297,4 @@ Credits
288297

289298
This package was originally created by [Barry vd. Heuvel](https://github.com/barryvdh) and is available here: [laravel-feed](https://github.com/barryvdh/laravel-translation-manager).
290299

291-
Currently is developed by [HighSolutions](http://highsolutions.pl), software house from Poland in love in Laravel.
300+
Currently is developed by [HighSolutions](http://highsolutions.pl), software house from Poland in love in Laravel.

src/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function importTranslations($replace = false)
4545
$counter = 0;
4646
foreach($this->files->directories($this->app['path.lang']) as $langPath) {
4747
$locale = basename($langPath);
48-
if ($locale === 'vendor')
48+
if(in_array($locale, $this->config['exclude_langs']))
4949
continue;
5050

5151
foreach($this->files->allfiles($langPath) as $file) {

0 commit comments

Comments
 (0)