3 namespace Drupal\field\Plugin\migrate\source\d6;
6 * Gets field option label translations.
9 * id = "d6_field_option_translation",
10 * source_module = "i18ncck"
13 class FieldOptionTranslation extends Field {
18 public function query() {
19 // Get the fields that have field options translations.
20 $query = $this->select('i18n_strings', 'i18n')
29 ->condition('i18n.type', 'field')
30 ->condition('property', 'option\_%', 'LIKE')
31 ->isNotNull('translation');
32 $query->leftJoin('locales_target', 'lt', 'lt.lid = i18n.lid');
33 $query->leftjoin('content_node_field', 'cnf', 'cnf.field_name = i18n.objectid');
34 $query->addField('cnf', 'field_name');
35 $query->addField('cnf', 'global_settings');
36 // Minimise changes to the d6_field_option_translation.yml, which is copied
37 // from d6_field.yml, by ensuring the 'type' property is from
38 // content_node_field table.
39 $query->addField('cnf', 'type');
40 $query->addField('i18n', 'type', 'i18n_type');
48 public function fields() {
50 'property' => $this->t('Option ID.'),
51 'objectid' => $this->t('Object ID'),
52 'objectindex' => $this->t('Integer value of Object ID'),
53 'format' => $this->t('The input format used by this string'),
54 'lid' => $this->t('Source string ID'),
55 'language' => $this->t('Language code'),
56 'translation' => $this->t('Translation of the option'),
57 'plid' => $this->t('Parent lid'),
58 'plural' => $this->t('Plural index number in case of plural strings'),
60 return parent::fields() + $fields;
70 public function getIds() {
71 return parent::getIds() +
73 'language' => ['type' => 'string'],
74 'property' => ['type' => 'string'],