Problem/Motivation

There are several places in the entity system code assuming that the entity language field is named 'langcode'. Actually this is just a convention all core entities are respecting, but there's nothing enforcing it, aside from the fact tha things won't work unless your entity language field is properly named. This is not flexible enough and inconsistent with other key fields, such as the entity id or bundle.

Proposed resolution

Introduce a 'langcode' entity key and use it wherever 'langcode' is currently hard-coded.

Remaining tasks

  • Write a patch
  • Review it

User interface changes

None

API changes

Just an API addition.

Comments

plach’s picture

Issue summary: View changes

This is close to a bug actually, as nothing prevents developers to define language fields having different names from 'langcode'.

plach’s picture

Title: Ensure entity language field name can be defined by the provider » Ensure entity language field name can be defined by the entity provider

Better title

plach’s picture

Status: Active » Closed (duplicate)
plach’s picture