- 🇩🇪Germany szeidler Berlin
If I understand it correctly is the language switcher block using the native language names, isn't it? That would mean we could just set it to the language code of the language that is supposed to be rendered as a switcher link? Which essentially also should always be the same as the hreflang attribute value?
Then we would need to go into all classes implementing
LanguageSwitcherInterface
and add the attribute there, similar to this.foreach ($this->languageManager->getNativeLanguages() as $language) { $links[$language->getId()] = [ // We need to clone the $url object to avoid using the same one for all // links. When the links are rendered, options are set on the $url // object, so if we use the same one, they would be set for all links. 'url' => clone $url, 'title' => $language->getName(), 'language' => $language, 'attributes' => ['class' => ['language-link'], 'lang' => $language->getId()], 'query' => $query, ]; }
Is it easy as that?