Fix lettura lingue da tradurre
This commit is contained in:
parent
935738af86
commit
11e4482d0a
|
@ -73,10 +73,11 @@ trait RecordTrait
|
||||||
*/
|
*/
|
||||||
public function save(array $options = [])
|
public function save(array $options = [])
|
||||||
{
|
{
|
||||||
if ($this->id) {
|
if ($this->id && method_exists($this, 'getTranslatedFields')) {
|
||||||
// Lingue aggiuntive disponibili
|
// Lingue aggiuntive disponibili
|
||||||
$langs = Locale::All()->toArray();
|
$langs = Locale::All()->pluck('id')->toArray();
|
||||||
$other_langs = array_diff($langs, [Locale::getDefault()->id]);
|
$default_lang = Locale::getDefault();
|
||||||
|
$other_langs = array_diff($langs, [$default_lang->id]);
|
||||||
|
|
||||||
// Popolo inizialmente i campi traducibili o allineo quelli uguali
|
// Popolo inizialmente i campi traducibili o allineo quelli uguali
|
||||||
foreach ($this->getTranslatedFields() as $field) {
|
foreach ($this->getTranslatedFields() as $field) {
|
||||||
|
|
Loading…
Reference in New Issue