File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,7 @@ protected static function bootTranslatable()
48
48
//Check if string was json or translation key
49
49
foreach ((array ) with (new self )->translatable as $ item ) {
50
50
if ($ model ->{$ item }) {
51
- $ updated_locales = array_filter ($ model ->{$ item }, function ($ var ) {
52
- return strlen (strip_tags (trim ($ var ))) != 0 ;
53
- });
51
+ $ updated_locales = $ model ->{$ item };
54
52
55
53
$ original = $ model ->getOriginal ($ item );
56
54
$ original_locales = json_decode ($ original , true );
@@ -96,6 +94,17 @@ protected static function bootTranslatable()
96
94
97
95
}
98
96
97
+ // public function __get($key)
98
+ // {
99
+ // if (in_array($key, (array) $this->translatable)) {
100
+ // if (array_key_exists($key, $this->attributes) || $this->hasGetMutator($key)) {
101
+ // return new Translate($this->getAttributeValue($key), static::class);
102
+ // }
103
+ // }
104
+ // // TODO: Implement __get() method.
105
+ // return parent::__get($key);
106
+ // }
107
+
99
108
/**
100
109
* @param array $attributes
101
110
* @param null $connection
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class Translate {
26
26
*/
27
27
public function __construct ($ string = '' , $ domain = '' )
28
28
{
29
- $ decode = json_decode ($ string , true );
29
+ $ decode = is_string ( $ string ) ? json_decode ($ string , true ) : $ string ;
30
30
$ this ->translations = $ decode ? $ decode : [
31
31
config ('app.fallback_locale ' ) => $ string
32
32
];
You can’t perform that action at this time.
0 commit comments