original_string: public function prepareTranslations(&$request)
      {
          $translations = [];
  
          // Translatable Fields
          $transFields = $this->getTranslatableAttributes();
  
          foreach ($transFields as $field) {
              $trans = json_decode($request->input($field.'_i18n'), true);
  
              // Set the default local value
              $request->merge([$field => $trans[config('admin.multilingual.default', 'en')]]);
  
              $translations[$field] = $this->setAttributeTranslations(
                  $field,
                  $trans
              );
  
              // Remove field hidden input
              unset($request[$field.'_i18n']);
          }
  
          // Remove language selector input
          unset($request['i18n_selector']);
  
          return $translations;
      }
code: public function prepareTranslations(&$request)
      {
          $translations = [];
  
          // Translatable Fields
          $transFields = $this->getTranslatableAttributes();
  
          foreach ($transFields as $field) {
              $trans = json_decode($request->input($field.'_i18n'), true);
  
              // Set the default local value
              $request->merge([$field => $trans[config('admin.multilingual.default', 'en')]]);
  
              $translations[$field] = $this->setAttributeTranslations(
                  $field,
                  $trans
              );
  
              // Remove field hidden input
              unset($request[$field.'_i18n']);
          }
  
          // Remove language selector input
          unset($request['i18n_selector']);
  
          return $translations;
      }
code_tokens: public function prepareTranslations ( & $ request ) { $ translations = [ ] ; // Translatable Fields $ transFields = $ this -> getTranslatableAttributes ( ) ; foreach ( $ transFields as $ field ) { $ trans = json_decode ( $ request -> input ( $ field . '_i18n' ) , true ) ; // Set the default local value $ request -> merge ( [ $ field => $ trans [ config ( 'admin.multilingual.default' , 'en' ) ] ] ) ; $ translations [ $ field ] = $ this -> setAttributeTranslations ( $ field , $ trans ) ; // Remove field hidden input unset ( $ request [ $ field . '_i18n' ] ) ; } // Remove language selector input unset ( $ request [ 'i18n_selector' ] ) ; return $ translations ; }
docstring: Prepare translations and set default locale field value.
  
  @param object $request
  
  @return array translations
docstring_tokens: Prepare translations and set default locale field value .