FieldLabelDescriptionTranslation.php in Drupal 10
File
core/modules/field/src/Plugin/migrate/source/d6/FieldLabelDescriptionTranslation.php
View source
<?php
namespace Drupal\field\Plugin\migrate\source\d6;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
class FieldLabelDescriptionTranslation extends DrupalSqlBase {
public function query() {
$query = $this
->select('i18n_strings', 'i18n')
->fields('i18n', [
'property',
'objectid',
'type',
])
->fields('lt', [
'lid',
'translation',
'language',
])
->condition('i18n.type', 'field');
$condition = $query
->orConditionGroup()
->condition('property', 'widget_label')
->condition('property', 'widget_description');
$query
->condition($condition);
$query
->innerJoin('locales_target', 'lt', '[lt].[lid] = [i18n].[lid]');
return $query;
}
public function fields() {
return [
'property' => $this
->t('Profile field ID.'),
'lid' => $this
->t('Locales target language ID.'),
'language' => $this
->t('Language for this field.'),
'translation' => $this
->t('Translation of either the title or explanation.'),
];
}
public function getIds() {
$ids['property']['type'] = 'string';
$ids['language']['type'] = 'string';
$ids['lid']['type'] = 'integer';
$ids['lid']['alias'] = 'lt';
return $ids;
}
}