Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 9f67ebc2 authored by escuriola's avatar escuriola
Browse files

OEL-1307: Use the EuropeanLanguages internal language id in the language modal.

parent 71209dd7
No related branches found
No related tags found
2 merge requests!103Merge 1.x into EPIC-OEL-1255-migrate-paragraphs, and up oebt version.,!91OEL-1307: Update oe_whitelabel to BCL 0.20.0
......@@ -17,6 +17,10 @@ use Drupal\oe_whitelabel_helper\EuropeanUnionLanguages;
function oe_whitelabel_preprocess_links__language_block(&$variables) {
$currentLanguage = \Drupal::languageManager()->getCurrentLanguage();
$current_language_id = $currentLanguage->getId();
$language_internal = $current_language_id;
if (EuropeanUnionLanguages::hasLanguage($current_language_id)) {
$language_internal = EuropeanUnionLanguages::getInternalLanguageCode($current_language_id);
}
$language_config_storage = \Drupal::entityTypeManager()->getStorage('configurable_language');
$eu_links = [];
$non_eu_links = [];
......@@ -35,7 +39,7 @@ function oe_whitelabel_preprocess_links__language_block(&$variables) {
'name' => $label,
'id' => 'link_' . $language_code,
'label' => $label,
'lang' => $language_code,
'lang' => $language_internal,
];
if (!empty($current_language_id) && $language_code === $current_language_id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment