Import multilingual content to Babel website

Hi there,

i would like to import content (resource fields + TVs) via a CSV file. Basically what importX does, but I need to import my main language + one additional language and I would like to use Babel for my multilang setup.

Is there a way to import all the data at once from one single CSV?
Or would it be better to split it into my languages?
How does the resource-linking get handled?

We are talking about a clean install, if that matters.
Thanks in advance for your help!

With Babel, pages for different languages are just normal resources in a different context. Therefore you should be able to use ImportX with a column context_key to set the right context.

The linking of the resources is trickier. The linking information is stored in a TV with the name babelLanguageLinks and a structure like this:


You need the actual values of the resource-ids to create the linking, so you can’t create it beforehand in your CSV.

Maybe you can adjust the code of ImportX: Read the ID from $response and create the linking for every other row.

Or maybe you can run a snippet after the import to create the linking, if you have a way to determine (from the resources in MODx) which two belong together. For example by creating a (temporary) TV for the import with a value that is equal for both versions.