Two separate entities are Soft (or Asymmetric) Translations of each other when they do not use the built-in translation system, but should be considered localized versions of each other.
In some scenarios, it's not possible (or desirable) to use core's translation system, for example when using paragraphs and expecting different paragraph types per language for the same field. This module provides a mechanism for creating and managing Soft Translations.
Features
- Automatically detects Soft Translations, when there is an alias match. For example, if node 1 (English only) has alias
/en/foo/barand node 2 (French only) has alias/fr/foo/bar, the system will automatically identify them as soft translations. - Provides an API for getting the Soft Translation(s) of a given entity. Example usage:
$st = \Drupal::service('soft_translations.manager')->getSoftTranslations($node); - Displays Soft Translations on the Translations overview page ("Translate" tab)
- Adds matching hreflang links for Soft Translations
- Ability to "Split off" a real translation into a Soft Translation
- Adds Soft Translations into language switcher links
- Optionally give preference to a soft translation (when existing), in the fallback candidates system. (For instance, if a node has an entity-reference field that displays teasers of other nodes, Drupal will try to render the teaser in the language of the main node. If the teaser doesn't have a translation, but a soft-translation instead, this feature can be enabled (enable the
soft_translations_fallbacksubmodule).
Roadmap and new features
Feel free to create a new issue if you have a use case not covered by the current feature-set. Ideas for new development include:
- Create a "manual selection" operation mode. This would allow editors manually picking (through an entity_ref field, or similar) nodes to be soft translations of a given node. This makes the UI hard though, since for each language we would need to allow the possibility to choose a different node.
- Currently the language switch links are only altered when viewing the node detail page. We could expand this to more advanced cases if necessary.
- ...
Supporting organizations:
Initial development, maintenance
Project information
- Project categories: Multilingual
82 sites report using this module
- Created by marcoscano on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.



