3 namespace Drupal\config_translation\Plugin\migrate\source\d6;
5 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
8 * Gets i18n strings profile field source from database.
11 * id = "d6_profile_field_translation",
12 * source_module = "i18nprofile"
15 class ProfileFieldTranslation extends DrupalSqlBase {
20 public function query() {
21 $query = $this->select('profile_fields', 'pf')
22 ->fields('pf', ['fid', 'name'])
23 ->fields('i18n', ['property'])
24 ->fields('lt', ['lid', 'translation', 'language']);
25 $query->leftJoin('i18n_strings', 'i18n', 'i18n.objectid = pf.name');
26 $query->leftJoin('locales_target', 'lt', 'lt.lid = i18n.lid');
33 public function fields() {
35 'fid' => $this->t('Profile field ID.'),
36 'lid' => $this->t('Locales target language ID.'),
37 'language' => $this->t('Language for this field.'),
38 'translation' => $this->t('Translation of either the title or explanation.'),
45 public function getIds() {
46 $ids['fid']['type'] = 'integer';
47 $ids['language']['type'] = 'string';
48 $ids['lid']['type'] = 'integer';
49 $ids['lid']['alias'] = 'lt';