I’m working on a multilingual site - Heb/Eng.
I need the menu to be placed on different sides of the page for each language and the text alignment to change accordingly as well.
The documentation on the matter suggests to duplicate the menu and use .hide()/.show() for each language.
That worked with the hiding/showing for a hot second, but I still have issues:
- Even though I have different ids for each menu copy, if I change the placement of one of them, it affects the other one. Of course it does that for the text-alignment as well.
- I can’t figure out how to access the content of the menu to change the text alignment. I couldn’t find a way to use it on the menu id itself, nor do I know how to refer to the menus children.
This is the code from the documentation regarding the hiding and showing the menu, which I tried to use as a base for the styling as well.
import wixWindow from ‘wix-window’ ;
$w . onReady ( function () {
let myLang = wixWindow . multilingual . currentLanguage ;
if ( myLang === ‘he’ ) {
$w ( ‘#LTREnglishMenu’ ). hide ();
$w ( ‘#RTLHebrewMenu’ ). show ();
} else {
$w ( ‘#RTLHebrewMenu’ ). hide ();
$w ( ‘#LTREnglishMenu’ ). show ();
};
});
Thanks.