Skip to content

Feature Request: introduce option to disable fallback to default locale when translating entities #5

@CreativeNative

Description

@CreativeNative

Feature Request: Introduce option to disable fallback to default locale when translating entities.

Description

Currently, when using the translation method (e.g. translate($entity, $locale)), the bundle automatically falls back to the default locale if no translation exists for the requested locale. This means that when you request a locale such as it_IT and no translation exists yet, the default locale’s data get returned and your form is pre‑populated with “old” data. In numerous instances (e.g., entity translation forms), it is preferable to get an empty translation object instead, so that the form is initially blank and the translator can decide to create a new translation rather than editing the default.

Proposed Changes

  • Introduce a new configuration option under the bundle, e.g.
  tmi_translation:
      allow_fallback_to_default: false

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions