src/Http/Controllers/VoyagerMenuController.php
protected function saveMenuTranslations($_menuItem, &$data, $action)
    {
        if (isBreadTranslatable($_menuItem)) {
            $key = $action.'_title_i18n';
            $trans = json_decode($data[$key], true);

            // Set field value with the default locale
            $data['title'] = $trans[config('voyager.multilingual.default', 'en')];

            unset($data[$key]);             // Remove hidden input holding translations
            unset($data['i18n_selector']);  // Remove language selector input radio

            $_menuItem->setAttributeTranslations(
                'title', $trans, true
            );
        }
    }
protected function saveMenuTranslations($_menuItem, &$data, $action)
    {
        if (isBreadTranslatable($_menuItem)) {
            $key = $action.'_title_i18n';
            $trans = json_decode($data[$key], true);

            // Set field value with the default locale
            $data['title'] = $trans[config('voyager.multilingual.default', 'en')];

            unset($data[$key]);             // Remove hidden input holding translations
            unset($data['i18n_selector']);  // Remove language selector input radio

            $_menuItem->setAttributeTranslations(
                'title', $trans, true
            );
        }
    }
protected function saveMenuTranslations ( $ _menuItem , & $ data , $ action ) { if ( isBreadTranslatable ( $ _menuItem ) ) { $ key = $ action . '_title_i18n' ; $ trans = json_decode ( $ data [ $ key ] , true ) ; // Set field value with the default locale $ data [ 'title' ] = $ trans [ config ( 'voyager.multilingual.default' , 'en' ) ] ; unset ( $ data [ $ key ] ) ; // Remove hidden input holding translations unset ( $ data [ 'i18n_selector' ] ) ; // Remove language selector input radio $ _menuItem -> setAttributeTranslations ( 'title' , $ trans , true ) ; } }
Save menu translations.

@param object $_menuItem
@param array  $data      menu data
@param string $action    add or edit action

@return JSON translated item
Save menu translations .