Problem/Motivation

originally posted here: #3210073: Certain "Interface" items don't adhere to editor's language setting

Language Switcher is currently done incorrectly. It is based off getDerivativeId(). Not sure what that is; but it return 'language_interface' and it should be 'language_content'.

it has this code:

$type = $this->getDerivativeId();
$language = $this->languageManager->getCurrentLanguage($type)->getId();

and the $type returned by getDeriviateId() is 'language_interface'; which is incorrect for the language switcher. The LS should be set by the content language; not the interface language. The easiest solution is to simply set $type to be 'language_content'.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

liquidcms created an issue. See original summary.

liquidcms’s picture

Status: Active » Needs review
StatusFileSize
new589 bytes

patch attached.

  • sylus committed ede2330 on 8.x-4.x authored by liquidcms
    Issue #3214421 by liquidcms: Language switcher is based on wrong...
sylus’s picture

Status: Needs review » Fixed

Thanks so much this makes sense!

Committed and attributed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

liquidcms’s picture

For anyone stumbling upon this issue, see this for a more recent solution: #3219470: Language block - use correct language type to get current language

joseph.olstad’s picture

@LiquidCMS, nice work on this fix, thanks, just noticing now!