5

I returned to a site designed months ago, and added a second language to it.

From the beginning, this site had prominent composition of entries out of multiple elements in their matrix, with formatting choices selectable on the elements (like positioning and size for images; or position left or right for compound pull quote/citation blocks.

This all works fine, and now in languages. However, there is the fact that languages other than the first used seem not ever never to have their Matrix of content blocks copied over into the new language. The Matrix is there, of course, but empty.

This emptiness is the case with first save starting with an entirely fresh entry, which is a noted in the add as the only case at present where Craft normally copies content to other available languages, and very handily so.

Really I think this is a bug report, but maybe not?

Add:

At present copy over does, as commented below, operate only at the point of first save to a first language. If you edit after saving, only that first save will have been copied, and your edits won't be. If you add fields to the section, and fill them in for a first language, nothing will be copied for those to other languages.

This is clearly worth looking into for persons who use multiple languages/Locales, but isn't so simple to do well, and I believe it is somewhere down the list for Craft futures, likely properly so compared other desires. Worth mentioning, though ;)

  • What's special to that first entry, that it's content got copied over to your new locale? And why do you expect an entirely fresh entry to be not empty? :D – carlcs Aug 8 '14 at 6:44
  • might be some misunderstanding here. Content in other elements is copied over to fresh languages - this gives a starting point for translation, and a non-blank page for that language on the live site. There was no special first entry - nothing got copied over into the new language's Matrix. – narration_sd Aug 8 '14 at 8:05
  • "languages other than the first entry seem not ever" still confuses me. What's that first entry you're talking about, and when you write "not ever", is matrix content copied over under certain circumstances? – carlcs Aug 8 '14 at 8:16
  • Ja, just noticed that. I'll edit it - it is unintended; meant the first language. – narration_sd Aug 8 '14 at 8:17
  • Good to know that you get the primary locale's content with a fresh locale. Did you test if the "matrix bug" only happened with the fresh install of your locale or if this is also true for new entries, where content is expected to be copied over on the first save? – carlcs Aug 8 '14 at 8:23
6

Ok, in some conversation with Brandon which leaned this direction, I realized a different direction to temporarily solving most of this problem.

It turns out that a root of the issues is that marking a Matrix as translatable causes the base problem here, that the set of elements in an original language isn't copying at all into other Locales, as would be expected on first Save as all other kinds of elements do.

If you don't mark the Matrix as translatable, two good things happen:

  • All Matrix elements now do get copied over, so that you don't have to recreate the Matrix in its individual form for each Entry and language.
  • Text items marked as translatable do have their original text copied over, so that you have a starting situation for language translation

It's true that Assets marked as translatable show up empty rather than with their original content, but at least they are there.

We also don't really know what marking a Matrix as translatable should mean. I suspect it should mean that all contained elements are marked translatable, but we shall see.

The Craft crew is well aware of issues here, and plans a careful improvement of the whole area, which as complex isn't at the top of lists yet.

This little detail should get most of us through until that happens, and given we set up the non-translatability of Matrix elements, should make extra steps explainable to customer end users.

| improve this answer | |
  • 1
    What for ist the «Mark as Translatable» checkbox on the Matrix element level anyway? – KSPR Oct 7 '14 at 11:59
  • Wow, Amazing! As soon as I removed the checkmark from make matrix translatable, and saved the page, the other locales copied over the english. Thanks a bunch! just saved me a lot of time of recreating the whole page. I had matrixes inside NEO so a complex structure, and all got fixed thanks to that! – mateostabio Oct 19 '17 at 13:32
2

Entry content is copied over to other locales on the VERY FIRST save of the entry (doesn't matter if it is your primary or one of you secondary locales). When a fresh locale is set up, all the content of all your entries should get copied over to this fresh locale.

If Matrix content is not copied over, I think you're right and this is a bug.

I think Jamie is right, content is only copied over to other locales on the VERY FIRST save of an entry. I think you're out of luck, if your second locale didn't exist back then.

But there were multiple feature request on Craft's Google+ site for better syncing options across locales. Other problems mentioned there were, that you have no indication about which fields are always synchronized (not marked as translatable) or which fields are still in sync across all locales (marked as translatable). Another idea was to have smallish buttons, to trigger a new sync for the select field on the next save.

It is probably not easy to implement these features, but I am confident that P+T will continue to improve on localization.

| improve this answer | |
  • Sorry @carlcs, I removed my original comment because I had a second thought as to if it was right or not! But yes, you pretty much summed up what I had anyway, so thanks. – Jamie Wade Aug 8 '14 at 7:27
  • Well, see above. This is exactly what I'm noting, that after the save on a new entry, no content is copied over to another language's Matrix. I just added simple plain text and rich text fields to the section, then created a new entry with those and some Matrix elements filled in. Saved. Opened again (just to preclude cntl-S from being an issue). Moved to second language. The simple text and rich texts copied over. None of the three Matrix elements did - the new language (Norwegian) Matrix is empty. That's the problem - I'm pretty familiar with how the rest works, should say... – narration_sd Aug 8 '14 at 8:11
  • and yes, I am one of the askers for better range of copy-over abilities in times past. They can only do so much at a time at Craft Central. I just think basic Matrix copy should work. It's a lot of effort if not - locating images or pull quote references again, etc., and those will likely not need translating. – narration_sd Aug 8 '14 at 8:13
2

I'm also struggeling with a multi-language scenario. We've got german as first locale, english as second and five other languages on top of it. The matrix field is marked as translatable as are some text-blocks. I don't know how it happened but the contents and structure of the english entries were filled with the german content when I started to work on it. All other languages are empty. I tried to mark the matrix fields as not translatable, added a new locale and tried to resave the german pages. This leads to completely filled entries with german contents but the entries which already had translated content are overwritten by german texts. If I resave english entries, the english texts overwrite all others.

So, from my point of view this should be the workflow that leads to the best results:

  1. Start with one locale
  2. Mark the matrix field as "not translatable"
  3. Mark the blocks in the matrix fields as translatable
  4. Finish your work on the first localization 100%
  5. Add all(!) additional locales at /settings/locales
  6. Add these locales to your section(s)
  7. Resave all entries of your initial language
  8. Fill your entries with translated content

If you add a new locale after that process you will have to start with an empty matrix. If not or if you have suggestions on a better workflow, please let me know.

| improve this answer | |
  • Thanks for posting your workflow, but this is nothing I can and want to tell my client. They will ask "why again do you like Craft that much" ;-) – Mario Nov 30 '17 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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