import icon indicating copy to clipboard operation
import copied to clipboard

Import for multiple locale

Open ockam opened this issue 9 years ago • 11 comments

Is it possible to import entries in multiple locales?

If not, do you think it’s possible to make separate import but to reconcile them at the db level?

ockam avatar Feb 29 '16 16:02 ockam

Yes, just use the field "locale"

boboldehampsink avatar Feb 29 '16 17:02 boboldehampsink

Is there a way to link multiple locales of the same entry?

ockam avatar Feb 29 '16 18:02 ockam

What do you mean with "link"

boboldehampsink avatar Feb 29 '16 18:02 boboldehampsink

For example, If I have a french and english version of the same news entry, how can I import both and have them show as a unique entry in the CP?

ockam avatar Feb 29 '16 18:02 ockam

Just use separate rows, one row with locale fr and one row with locale en

boboldehampsink avatar Feb 29 '16 18:02 boboldehampsink

Which field should I use to map both line to the same entry?

Currently, my CSV contains key, title, body, post_date, locale, where key is the same on both line/locale.

ockam avatar Feb 29 '16 18:02 ockam

That will work when you append data and set key as unique criterium.

boboldehampsink avatar Apr 05 '16 07:04 boboldehampsink

I've recently tried this too and end up with duplicate entries instead of one entry with multiple locales.

jmisavage avatar Apr 09 '16 10:04 jmisavage

This is an important issue. If an entry has multiple locals. How do we target each language individually with the import?

zachshallbetter avatar Apr 27 '16 02:04 zachshallbetter

I've managed to get this working. Here's how I did it.

I applied a unique key to my entries and used the same key in en and fr. Create that Key field in your Section in Craft and import it. I also included the Locale in my csv, obviously.

First CSV to import, choose Append Data. This will create all the new entries. Second CSV to import, choose Replace Data. On the next page, you will be asked what Criterium to use to consider duplicates. Choose Key and Locale.

There you go, you should be all set.

Not very elegant though. Could be done better.

I would also suggest an option to clear the Slug in the import language because right now, all the slugs are in the first language and I have to go in and manually delete and save them one by one to get it in the correct language.

echantigny avatar May 26 '16 19:05 echantigny

@echantigny thanks for finding a solution.

Regarding the slug issue, this SO post may help.

ockam avatar Jun 22 '16 19:06 ockam