protected function newTranslation($locale = null, array $attributes) {
        $locale = isset($locale) ? $locale : Locale\get_active_locale();

        $language = $this->getByLocale($locale);

        $class = $this->classTranslation();

        $update = [
            'language_id' => $language->id,
             isset($this->translation_id) ? $this->translation_id : str_singular($this->getModel()->getTable()) . '_id' => $this->id,
        ];

        $attributes = array_merge($update, $attributes);

       return $class::updateOrCreate($update, $attributes);
    }
protected function newTranslation($locale = null, array $attributes) {
        $locale = isset($locale) ? $locale : Locale\get_active_locale();

        $language = $this->getByLocale($locale);

        $class = $this->classTranslation();

        $update = [
            'language_id' => $language->id,
             isset($this->translation_id) ? $this->translation_id : str_singular($this->getModel()->getTable()) . '_id' => $this->id,
        ];

        $attributes = array_merge($update, $attributes);

       return $class::updateOrCreate($update, $attributes);
    }
protected function newTranslation ( $ locale = null , array $ attributes ) { $ locale = isset ( $ locale ) ? $ locale : Locale \ get_active_locale ( ) ; $ language = $ this -> getByLocale ( $ locale ) ; $ class = $ this -> classTranslation ( ) ; $ update = [ 'language_id' => $ language -> id , isset ( $ this -> translation_id ) ? $ this -> translation_id : str_singular ( $ this -> getModel ( ) -> getTable ( ) ) . '_id' => $ this -> id , ] ; $ attributes = array_merge ( $ update , $ attributes ) ; return $ class :: updateOrCreate ( $ update , $ attributes ) ; }
Get new translation instance .

@param null $locale
@param array $attributes
@return mixed
Get new translation instance .