Hi Pelw,
This is the first I’ve seen of the language switcher in the menu for WPML, so there is no support for it yet.
I’ve looked at the code for WPML and the language switcher is not added to the menu in a way I’d expect or in a way that allows plugins to modify its behaviour.
Due to the way it is coded I would not be able to make this functionality compatible with MMM, I would need to add my own version of the language switcher.
If you want to make manual edits you will need to edit this file:
sitepress-multilingual-cms/inc/language-switcher.php
Find (line 630):
$items .= '<li class="menu-item menu-item-language menu-item-language-current">';
Replace with:
$items .= '<li class="mega-menu-item mega-menu-item-has-children mega-align-bottom-left mega-menu-flyout">';
Find (632):
$items .= '<a href="#" onclick="return false">';
Replace with:
$items .= '<a class="mega-menu-link" href="#" onclick="return false">';
Find (714):
$sub_items .= '<li class="menu-item menu-item-language">';
$sub_items .= '<a href="' . $lang[ 'url' ] . '">';
Replace with:
$sub_items .= '<li class="mega-menu-item">';
$sub_items .= '<a class="mega-menu-link" href="' . $lang[ 'url' ] . '">
';
Find (726):
$sub_items = $sub_items && $menu_is_vertical ? '<ul class="sub-menu submenu-languages">' . $sub_items . '</ul>' : $sub_items;
Replace with:
$sub_items = $sub_items && $menu_is_vertical ? '<ul class="mega-sub-menu submenu-languages">' . $sub_items . '</ul>' : $sub_items;
Finally, go to Mega Menu > Menu Themes and add the following to the Custom Styling area of your theme:
#{$wrap} #{$menu} li.mega-menu-item a.mega-menu-link img.iclflag {
display: inline;
margin-right: 5px;
}
Regards,
Tom