the Bosnian language has the wrong flag

Created on 4 December 2024, 3 months ago

Hi there,
first I want to praise your module. Very nice and functional.
The Bosnian language has the wrong flag.
in the program 'LanguageSelectorBlock.php'
you have hard coded flag code for English language. ("en" ? "gb") the same should be done for the Bosnian language ("bs" ? "ba")

Thanks Mirsad

/**
* Set the custom info to the links.
*
* @param \stdClass $links
* The links.
*
* @return void
*/
private function parseLinks(\stdClass &$links): void {
$current_language = $this->languageManager->getCurrentLanguage();
foreach (array_keys($links->links) as $langcode) {
$language = $this->languageManager->getLanguage($langcode);
$flagcode = $langcode == 'en' ? 'gb' : $langcode;
$links->links[$langcode]['langcode'] = $language->getId();
$links->links[$langcode]['icon'] = $this->getFlagIcon($flagcode);
$links->links[$langcode]['uri'] = $this->getCurrentUri($langcode);
$links->links[$langcode]['current_langcode'] = $current_language->getId();
}
}

🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇧🇦Bosnia and Herzegovina cobra007

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cobra007
  • 🇪🇸Spain xurdep Gijón

    Thank you for your report!
    I'll include in the next version!
    Thanks for using it!

  • 🇪🇸Spain xurdep Gijón

    Thank you all for the reports and the patch. I have finally decided to discard the patch and implement a solution for all languages available in Drupal by default. Thank you all once again!

  • 🇪🇸Spain xurdep Gijón

    Thank you all for the reports and the patch. I have finally decided to discard the patch and implement a solution for all languages available in Drupal by default. Thank you all once again!

Production build 0.71.5 2024