File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 $ group = Group::build ($ nome , $ theme , $ id_module_start );
4040 $ id_record = $ dbo ->lastInsertedID ();
4141 $ group ->editable = 1 ;
42- $ group ->setTranslation ('title ' , $ nome );
4342 $ group ->save ();
4443
4544 if ($ id_module_start ) {
Original file line number Diff line number Diff line change @@ -77,13 +77,11 @@ public function save(array $options = [])
7777 if ($ this ->id && method_exists ($ this , 'getTranslatedFields ' )) {
7878 // Lingue aggiuntive disponibili
7979 $ langs = Locale::All ()->pluck ('id ' )->toArray ();
80- $ default_lang = Locale::getDefault ();
81- $ other_langs = array_diff ($ langs , [$ default_lang ->id ]);
8280
8381 // Popolo inizialmente i campi traducibili o allineo quelli uguali
8482 foreach ($ this ->getTranslatedFields () as $ field ) {
85- $ value = $ this ->name ;
86-
83+ $ value = $ this ->name ?: $ this -> nome ;
84+
8785 foreach ($ langs as $ id_lang ) {
8886 $ translation = database ()->table ($ this ->table .'_lang ' )
8987 ->select ($ field )
@@ -94,17 +92,6 @@ public function save(array $options = [])
9492 if ($ translation ->count () == 0 ) {
9593 $ this ->setTranslation ($ field , $ value , $ id_lang );
9694 }
97-
98- // ...altrimenti la aggiorno se è uguale (quindi probabilmente non ancora tradotta)
99- /*
100- else{
101- if ($translation->first()->{$field} == $this->{$field}) {
102- $translation->update([
103- $field => $this->{$field},
104- ]);
105- }
106- }
107- */
10895 }
10996 }
11097 }
You can’t perform that action at this time.
0 commit comments