The language switcher module does not display flags in Joomla 3.9.10 and 4.1. Detailed code pointers below
Language switcher on frontend shows flags after following these steps: https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site/Language_Switcher
The module shows up, but no language options are shown
I dug a bit into the code of Joomla 3.9.10 and the culprit seems to be in this snippet:
$default = $menu->getDefault($item->lang_code);
if ($default && $default->language === $item->lang_code)
{
$homes[$item->lang_code] = $default;
}
(see: https://github.com/joomla/joomla-cms/blob/3.10-dev/modules/mod_languages/helper.php#L43 )
on my site, the $default->language
is equal to *
, probably because the default menu item has language settings 'All'. However '*' is not equal to a language code, e.g. 'en-GB', so no entries are added to the $homes
and later down in the helper. php, all language codes are discarder for this reason.
I observed the same behaviour in Joomla 4, but have not debugged the code in that case.
Labels |
Added:
No Code Attached Yet
|
You can try to install multilingual sample data. This gives you all you need for a multilingual site.
Closing as expected behavior. Feel free to re-open this issue when you have proceeded as recommended and it’s still not working.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-07-09 09:30:44 |
Closed_By | ⇒ | richard67 |
You need a couple "default menus" for multilanguage: one for ALL, and one per language.
https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site/Creating_menus