Instead of initalizing two entity translation objects when viewing/editing an entity translation load the entity directly into the current content language

Created on 24 December 2016, over 8 years ago
Updated 4 September 2025, 6 days ago

Currently when we are editing or loading an entity translation we first load the entity in the default translation and then initialize a new entity translation object for the desires translation. This however is unnecessary and for performance and memory reasons we should be loading the entity directly into the desired translaton and have only one instead of two entity objects.

This is actually pretty easy to do and we just have to set the property $activeLangcode in ContentEntityBase to the current content language code if the entity has a translation for it otherwise leave it set to the default language code as it is now. This however will be a really big BC break and in order to avoid it we could for Drupal 8 just introduce a site setting according to which we have the new or the previous behavior and deprecate the setting and in Drupal 9 make the new behavior the default one.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

entity system

Created by

πŸ‡©πŸ‡ͺGermany hchonov πŸ‡ͺπŸ‡ΊπŸ‡©πŸ‡ͺπŸ‡§πŸ‡¬

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024