getPropertyNotInRowTranslation example

public function prepareRow(Row $row) {
    if (!parent::prepareRow($row)) {
      return FALSE;
    }
    // Set the i18n string table for use in I18nQueryTrait.     $this->i18nStringTable = static::I18N_STRING_TABLE;
    // Save the translation for this property.     $property_in_row = $row->getSourceProperty('property');
    // Get the translation for the property not already in the row and save it     // in the row.     $property_not_in_row = ($property_in_row === 'title') ? 'body' : 'title';
    return $this->getPropertyNotInRowTranslation($row$property_not_in_row, 'bid', $this->idMap);
  }

  /** * {@inheritdoc} */
  public function fields() {
    return [
      'bid' => $this->t('The block numeric identifier.'),
      'format' => $this->t('Input format of the content block/box content.'),
      'lid' => $this->t('i18n_string table id'),
      'language' => $this->t('Language for this field.'),
      
// Put the language on the row as 'language'.     $row->setSourceProperty('language', $row->getSourceProperty('lt_language'));

    // Save the translation for this property.     $property_in_row = $row->getSourceProperty('property');

    // Set the i18n string table for use in I18nQueryTrait.     $this->i18nStringTable = 'i18n_string';
    // Get the translation for the property not already in the row and save it     // in the row.     $property_not_in_row = ($property_in_row == 'title') ? 'description' : 'title';
    return $this->getPropertyNotInRowTranslation($row$property_not_in_row, 'mlid', $this->idMap);
  }

  /** * {@inheritdoc} */
  public function fields() {
    $fields = [
      'title_translated' => $this->t('Menu link title translation.'),
      'description_translated' => $this->t('Menu link description translation.'),
    ];
    return parent::fields() + $fields;
  }
$row->setSourceProperty('language', $language);

    // Set the i18n string table for use in I18nQueryTrait.     $this->i18nStringTable = 'i18n_string';

    // Save the translation for the property already in the row.     $property_in_row = $row->getSourceProperty('property');

    // Get the translation for the property not already in the row and save it     // in the row.     $property_not_in_row = ($property_in_row == 'name') ? 'description' : 'name';
    return $this->getPropertyNotInRowTranslation($row$property_not_in_row, 'tid', $this->idMap);
  }

  /** * {@inheritdoc} */
  public function fields() {
    $fields = [
      'language' => $this->t('Language for this term.'),
      'name_translated' => $this->t('Term name translation.'),
      'description_translated' => $this->t('Term description translation.'),
    ];
    
return FALSE;
    }

    // Save the translation for this property.     $property_in_row = $row->getSourceProperty('property');

    // Set the i18n string table for use in I18nQueryTrait.     $this->i18nStringTable = static::I18N_STRING_TABLE;
    // Get the translation for the property not already in the row and save it     // in the row.     $property_not_in_row = ($property_in_row == 'title') ? 'description' : 'title';
    return $this->getPropertyNotInRowTranslation($row$property_not_in_row, 'mlid', $this->idMap);
  }

  /** * {@inheritdoc} */
  public function fields() {
    $fields = [
      'language' => $this->t('Language for this menu.'),
      'title_translated' => $this->t('Menu link title translation.'),
      'description_translated' => $this->t('Menu link description translation.'),
    ];
    
Home | Imprint | This part of the site doesn't use cookies.