Current behavior

  • CSV files can contain langcode field to create content in one specific language but it's not possible to generate migration for a content and it's translation atm

Expected behavior

  • Module could provide an easy way to generate migration for translations

Proposed resolution

  • TBD
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

davidferlay created an issue. See original summary.

sorlov made their first commit to this issue’s fork.

sorlov’s picture

Status: Active » Needs review

Added draft functionality, README file was updated with next infos:

## Multilingual translation support

Translation source files should be placed separately in **translation** folder.

They should have similar filename pattern, as original source files: `{entity_type}-{bundle}.csv` or `{entity_type}.csv`.

You can see some examples in /example/translation folder of this module.

Structure and content of translation source files are the same, but with some additional rules:
* In addition to first column with ID, need to have second column with langcode of translation.

* Translation source file is supposed to have only translated values, it makes no sense to duplicate it with same values as in original import file.

Need to review it

davidferlay’s picture

LGTM

So ID is used to link translation to original content right ? Meaning original content and all translations should share the ID value

davidferlay’s picture

Another question that comes to mind: is it implied that the translation directory is located inside the import directory ? (as defined in drush command)

so drush migrate_generator:generate_migrations /var/www/html/content --update
means that the translation directory is /var/www/html/content/translation

sorlov’s picture

So ID is used to link translation to original content right ?

yes, exactly

Another question that comes to mind: is it implied that the translation directory is located inside the import directory ? (as defined in drush command)

so drush migrate_generator:generate_migrations /var/www/html/content --update
means that the translation directory is /var/www/html/content/translation

yes, translation folder should be placed inside import one.

There are example files in example folder of module

davidferlay’s picture

Excellent :)

ilya.no’s picture

Status: Needs review » Reviewed & tested by the community

Feature works fine and code looks good. Thanks!

  • sorlov committed 4f9b04d on 8.x-1.x
    Issue #3249707: Migrate generator - Ability to generate migration to...
sorlov’s picture

Status: Reviewed & tested by the community » Fixed
sorlov’s picture

Status: Fixed » Closed (fixed)