Architecture Decision Records (ADRs)

← Home

Lock entity language on edit forms

Introduction

When setting up a multilingual site it is important to have a consistent original language for the entities instead of allowing editors to select the original language. This allows for consistency in the translation and makes implementation of custom functionality related to translations easier.

Decision

Disable language field in the form mode, set original default language for every translatable entity to be the default language of the website.

Context

The majority of our clients come to us with the website content being generated in a single language, and then this content is being translated to the other languages.

Disabling language select on the node allows for less editorial mistakes -- when editors may select the wrong language by accident or instead of translating an existing node / page they may create a new one in a different language breaking multilingual connection between pieces of content.

Disabling the language select allows to set the language to a default value and assure consistency throughout the content of the website. This leads to the simplification of back-end translation-related functionality and migration of the content. This also allows to have fallback language in case of certain content items not having a translation in a particular language.

To disable the select, keep the “Show language selector on create and edit pages” checkbox off in content type settings and set the default language to be site’s default language.

Drupal admin interface showing the Show language selector checkbox

Drag language select field into the disabled section of the form mode.

Drupal admin interface showing the language select field' checkbox

Consequences

Exceptions

Additional Resources

None

← See more ADRs