As I see it, there is currently no support for exporting custom blocks with multiple languages. Only the default language is exported. Is implementation planned for this?

Note: Normal blocks can be translated without the Structure Sync module.

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

fhaupt created an issue. See original summary.

timkruijsen’s picture

It was not yet on the roadmap, but I will try to look into this as soon as possible. If you have any suggestions I'd be very happy to hear them!

nikm’s picture

+1 for Multilingual support
Thank you very much!

awolfey’s picture

StatusFileSize
new6.67 KB

Here's a draft patch for block translation, using the Full method. It works for fields, but isn't really handling much else at this point.

I also noticed while working on this that only the first value of any field is exported/imported. I left that as is.

legolasbo’s picture

Status: Active » Needs review

This has a patch so it should be "Needs review"

fidovdbos’s picture

@awolfey thank you for the patch i wil check and see if it fits, i wil fix the issue with only export the first value of fiedls.

colan’s picture

Version: 8.x-1.4 » 8.x-1.x-dev

New features go into HEAD, which may turn out to be a 2.x branch if we have one.

sinasalek’s picture

Title: Multilingual Support » Multilingual Support for blocks

updated the title

louis-cuny’s picture

I just added the structure sync module and this patch to a project with already existing blocks in many languages.
The exported structure_sync.data.yml seems correct to me.

Then on a staging environment I did a drush ib --choice=force
The non-english custom blocks disapeared.

Did the patch work for anybody ? Did a do something wrong ?

louis-cuny’s picture

Version: 8.x-1.x-dev » 2.x-dev
Assigned: Unassigned » louis-cuny
StatusFileSize
new6.02 KB

I took a different way to write the exported block translations.
I handled both exporting and importing in safe, full and forced.

Let me know if everything works as expected for you

louis-cuny’s picture

StatusFileSize
new6.02 KB

Fix one missing char causing syntax error
Would be great to have some reviews

louis-cuny’s picture

StatusFileSize
new5.87 KB

Bad patch file sorry

louis-cuny’s picture

Status: Needs review » Needs work
dabley’s picture

Patch #12 doesnt apply to the latest version of Structure Sync (v2.0.5).
@louis-cuny - you have flagged this as "Needs Work" but it isn't clear what further work needs to be done. Can you clarify?

louis-cuny’s picture

The patch I created didn't work like I expected, I cannot remember exactly what was not working but their was some bugs

ressa’s picture

Title: Multilingual Support for blocks » Multilingual Support for custom blocks
Issue summary: View changes

Just clarifying that this issue is about custom blocks, since normal blocks are treating as configuration, and can be translated without this module.