Skip to content

Commit

Permalink
Update Translatable.php
Browse files Browse the repository at this point in the history
  • Loading branch information
grinry committed May 2, 2016
1 parent f5c1f63 commit e85c2a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Eloquent/Traits/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ protected static function bootTranslatable()
if (is_array($original_locales)) {
//Find and change only updated locales
foreach ($updated_locales as $locale => $value) {
$original_locales[$locale] = $value;
if (strlen(strip_tags(trim($value))) != 0)
$original_locales[$locale] = $value;
}
//remove empty translations from array and save as json
$model->{$item} = json_encode(array_filter($original_locales, function($var) {
Expand Down

0 comments on commit e85c2a9

Please sign in to comment.