The Translation Conundrum
In Drupal, it is often best to rely on core features or modules to do what you need. When it comes to Layout Builder block content and translating it, however, this becomes an arduous and nearly impossible feat.
While modules like Layout Builder Asymmetric Translation offer the ability to duplicate layouts across translation layers, they merely scratch the surface. Even the powerful Translation Management Tool (TMGMT) module, which revolutionized translation automation in Drupal, hasn't yet bridged this gap. Though there are ongoing development to address this limitation (like project/tmgmt/issue#3097660) we need practical solutions for the present.
Thinking Outside the Drupal Box
What if we approached this challenge from a different angle? Instead of wrestling with how Drupal stores inline block revisions, trying to grab them and manipulate them, we instead elevated translation to a layer above Drupal itselfstoring translations within Drupal's architecture, what if we elevated the translation layer above Drupal itself?
Sometimes the most elegant solutions come from questioning our fundamental assumptions about where and how content should be translated.
Enter GlobalLink Web: A Platform-Agnostic Solution
TransPerfect's GlobalLink Web tool offers an intriguing solution to this challenge. By operating independently of Drupal's internal systems, it provides a powerful mechanism for translating Layout Builder content without being constrained by traditional limitations.
With this solution the platform doesn't even really matter. This could be in WordPress, Umbraco, Contentful, Ghost, or just pure static HTML.
How It Works
- JavaScript-based solution running on TransPerfect's infrastructure
- Operates on specified URL paths or wildcards
- Dynamically scrapes and replaces origin language content with target translations
Where's my translation, dude?
You might be thinking "Won't that mean Drupal will never actually receive the translated content?" That is indeed true, since the translated content will exist outside the context of Drupal itself. However, TransPerfect solves this by being the translator between the reader and Drupal: sort of like a babelfish in The Hitchhiker's Guide to the Galaxy universe.
Here are two examples of how this feature solves the two major concerns resulting from this setup:
Search Functionality
If translations aren't stored in Drupal's (or your search platform's) database, then how does it work?
- Queries are translated at the DOM level from target to origin language
- Search results are delivered in the origin language and instantly translated to the target language
- The user experience remains seamless while maintaining Drupal's robust search capabilities
SEO Considerations
Likewise, if the site is always just the origin language how will site scrapers and indexers see the translated content? GlobalLink Web's approach already thought of that, and the solution is the same as the above for search functionality. It promises to enhance SEO in regions it was not previously scoped for by:
- Delivering translated DOM elements as crawlable pages (in the target language)
- Providing search engines with content in multiple languages
- Ensuring appropriate language delivery for search queries
Language Negotiation and Content Management
The system works harmoniously with Drupal's language negotiation mechanisms. Whether you're using subdirectories (website.com/fr
) or subdomains (fr.website.com
), GlobalLink Web adapts to your existing architecture. This means you can have differing content for your different translation layers (for a given node) even if the actual origin language is still just the default language (as opposed to the target language GlobalLink Web will be layering on top).
Content teams can even fine-tune translations using browser extensions that communicate directly with TransPerfect's translation database. For instance,GlobalLink Web can tap into your DeepL glossary to fetch synonyms and brand-/org-specific translations.
Looking Forward: A Note on Layout Paragraphs
For those starting fresh, it's worth considering Layout Paragraphs as an alternative to Layout Builder. This solution provides similar user experience benefits while maintaining inherent translatability through its use of paragraph types, which are fully compatible with both core translation features and TMGMT.
The key to success in Drupal development often lies not in forcing square pegs into round holes, but in recognizing when to adopt alternative approaches that better serve our needs. Accept… that only works if you are grazing in a greenfield of a new build.
In the end, whether you choose to implement GlobalLink Web for Layout Builder translation or opt for Layout Paragraphs in new projects, the goal remains the same: creating maintainable, translatable content that serves your users effectively.