I18nQueryTrait
trait I18nQueryTrait (View source)
Gets an i18n translation from the source database.
Properties
| protected string | $i18nStringTable | The i18n string table name. |
Methods
Gets the translation for the property not already in the row.
Details
protected bool
getPropertyNotInRowTranslation(Row $row, string $property_not_in_row, string $object_id_name, MigrateIdMapInterface $id_map)
Gets the translation for the property not already in the row.
For some i18n migrations there are two translation values, such as a translated title and a translated description, that need to be retrieved. Since these values are stored in separate rows of the i18nStringTable table we get them individually, one in the source plugin query() and the other in prepareRow(). The names of the properties varies, for example, in BoxTranslation they are 'body' and 'title' whereas in MenuLinkTranslation they are 'title' and 'description'. This will save both translations to the row.