Problem/Motivation

The builder edits the translation of the URL language: Instance::ensureCurrentTranslation() and DisplayBuildablePluginBase::getTranslationLangcode() read LanguageInterface::TYPE_URL, the rule kept in #3627287-9: Decide which language the builder edits: the URL one, or core's negotiated one.

Three checks read the interface language instead: the 404 guard of IntegrationControllerBase::renderBuilder(), EntityViewOverride::access() and LanguageSwitcher.

They agree while the interface language follows the URL prefix. They differ when it is negotiated another way, such as the "Account administration pages" method: both builder routes are admin routes.

Steps to reproduce

1. Add French, enable the "Account administration pages" detection for the interface language, and set your administration pages language to English.
2. Open the builder of a French translation, under /fr/.
3. The builder edits the French translation, but the language switcher shows EN as current and offers FR, and the 404 guard and the override access check test the English translation.

Proposed resolution

Read LanguageInterface::TYPE_URL in the three checks, and use the languages:language_url cache context in EntityViewOverride::access().

Comments

mogtofu33 created an issue.