I am attempting to add a second locale to a site with existing content, much of that content in matrix fields.

Following the documentation for Setting Up a Localized Site, I have defined the locale, enabled all sections for this locale (and the original one), set up the configuration and the index.php files. What I have not yet done is mark any field as translatable.

What I was expecting is that entries in the new locale would be initialized with content from the original locale. And this has happened, except that the matrix fields have not been duplicated, so the entries in the new locale do not have any of that matrix content.

This is very similar to How do I get Matrix elements to copy their content across language Locales?. The answer there is "don't mark matrix fields as translatable", which I haven't done, so not sure why this isn't working for me.

Any clues?

  • Maybe it helps if you set one field of your entry type as translatable (not the Matrix), but this is just a guess. – carlcs Oct 23 '14 at 23:13
  • @carlcs No, that didn't help: neither setting a different field in the entry type, or a sub-field in the matrix made any difference. The task to copy content across locales seems to run when you add a new locale, and when you save a section after enabling the new locale in that section. My craft_content table is multi-lingual, but the craft_matrixcontent_xxx ones are frustratingly not. – Marion Newlevant Oct 24 '14 at 6:22
  • Marion, you're probably better off solving this directly with P&T. This other Q/A you're referring to got them to find a temporary workaround. Only that it doesn't work for you. Hopefully they can help you out or tell you that they fix the bug. – carlcs Oct 24 '14 at 6:40
  • @MarionNewlevant This sounds like a bug. Can you please send us a ticket from your dashboard, so we can look into it? – Brandon Kelly Oct 29 '14 at 11:04

This is definitely a bug in Craft. Doesn't just affect Matrix, but any relational field as well (Assets, Users, etc.)

It's not an super-easy fix, but as a workaround, you can re-save the entry in the original locale (before making any edits in the new) and the content will get duplicated over.

  • Can I use ResaveAllElementsTask to help with this? – Marion Newlevant Oct 31 '14 at 19:04
  • Nope... that calls the ResaveElements task which is where the issue is. – Brad Bell Nov 1 '14 at 2:16
  • So, has this been fixed? Because what is happening now, is that I make one of the asset fields in the matrix translatable, and the next time the element is saved (long after the locale was added), the translatable asset is now only set in the one locale. – Marion Newlevant Mar 3 '15 at 18:56
  • Did you re-save the entry in the original locale first? – Brad Bell Mar 3 '15 at 19:13
  • 2
    @LukePearce Only fixed for Craft 3 and not likely to be backported. – Brad Bell Nov 29 '17 at 19:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.