Problem/Motivation
I want to configure the language detection behavior to be different for content language and interface language.
Therefore I check the checkbox "Customize Content language detection to differ from Interface text language detection settings" on the language detection settings (/admin/config/regional/language/detection). For the Interface text language I configure the Users selected language (Follow the user's language preference.) to be top priority for language detection as the admins want to have the toolbar, edit forms and so on to be in the language they chose, so that they can understand every field and function.
For the content language detection, I choose URL (Language from the URL (Path prefix or domain).) to be the top priority.
But now the dropdown language switcher isn't working anymore to switch between different content translations and it doesn't show the current content language because it seems to be using the interface language instead of the content language.
Proposed resolution
Change the module code, so that the dropdown language switcher depends on the content language (which you normally want to change with such a language switcher) instead of interface language.
Issue fork dropdown_language-3215172
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyIndeed I can confirm this!
Comment #3
anybodyComment #4
anybodyTrying to fix this in code I found the important part: The maintainer already solved this VERY smart:
So you simply have to use the other dropdown language block "Dropdown language (Content)". There's one for each language type! :)
Comment #5
skaughtDerivatives in the Block API are a interesting little treat.
This seems like the very discovery that is the cause of v1-v2 progression for this module.
noting (contrib releasing): a flaw in the Block API happens to be if you have already initialized a block definition, you can not add a deriver after..
Comment #6
skaughtlinking
Comment #7
guido_sThank you very much for this hint!
This module should definitely have some documentation on this.
Because different blocks for different language types are only available AFTER checking "Customize Content language detection to differ from Interface text language detection settings". And the default dropdown language block uses the interface language.
I didn't expect new available blocks in the list. I expected the dropdown language block that I already placed before to work as I expected it or to have some settings in the block or in the module configuration for it, but not that I can place a new block now and have to remove the dropdown language block I already placed.
Comment #8
skaught#7
Comment #9
skaughtComment #10
anybodyComment #11
skaught