Skip to content

Translate blocks #39

@olafgrabienski

Description

@olafgrabienski

There are a few custom blocks with content on the Backdrop4Good site:

  • Logo icons (no language specific content as the image has no alt attribute)
  • Call to Action icons
  • One liner CTAs
  • Sponsors
  • Footer

In contrast to nodes, blocks are not directly translatable by Backdrop at the moment. There is a workaround described in the core issue, UX: Layout UI: Collapsible block groups:

create multiple custom blocks (one for each language) [...] making sure that each custom block has a properly configured visibility (language)

Drawback, pointed out in the same issue description:

In websites with 2 or 3 languages this might not be a big deal, but when reaching close to a dozen languages, that makes the Layout UI really cluttered and just horrible to work with.

@klonos suggested to not wait on Backdrop 2 with extended language support but to improve the situation by adding "Collapsible block groups", i.e. the option "to group multiple blocks together and somehow collapse them so they don't get in the way all the time. That way one could create a [...] group of blocks that would include all the language-specific [...] blocks".

The "Collapsible block groups" suggestion got some positive feedback but there were also other suggestions based on different language related and block related core issues which made no more progress at a certain point. Subsequently, there were no more activities in the issue. In my opinion, the suggestion of @klonos remains an interesting approach to translate blocks.

So, to translate blocks on Backdrop4Good, there is one workaround which should work: create one block per language and set respective visibility conditions. In my opinion it's not ideal but manageable (Backdrop4Good is being translated to 4 languages at the moment).

There are however a couple of approaches to improve the situation. I'd like to discuss them first, as Backdrop4Good is a use case for general multilanguage improvements in Backdrop. Here are the approaches I'm aware of:

My favorite is the last one: make blocks directly translateable. This feature was also requested several times in the central Backdrop contrib i18n issue but i18n is far from working in Backdrop. So let's have a look at i18n and see if it's possible to port the block translation option to Backdrop core.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions