-
Notifications
You must be signed in to change notification settings - Fork 1
Description
There are a few custom blocks with content on the Backdrop4Good site:
- Logo icons (no language specific content as the image has no
altattribute) - 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:
- [UX] Layout UI: Collapsible block groups (see above)
- [CMI] Add config translation (blocks are configuration)
- Use nodes for blocks (nodes are translatable). See for instance:
- Make blocks directly translatable. In Drupal 7, this functionality is provided by the i18n module.
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.