> [wptouch menu] does not change with the language
> switch (although the actual content does …)
i just wanted to register my interest in this same question. thanks for testing this and bringing it up!
— wpwalker
Here’s what I got so far from WPtouch Pro support:
“WPtouch Pro currently only includes official support for WPML. What we can do is add this to the list of feature requests to consider for a later release. Looking back, there haven’t been other support requests for Polylang. So we hadn’t seen this reported before. So thank you for letting us know and for helping make WPtouch Pro even better. WPtouch Pro’s developers will consider the feature in a later release.”
After I begged to look into it, I got this:
Martin [apparently one of the developers] took a look at this and some noticeable differences between WPML and Polylang are that:
“WPML stores translations as part of the post (presumably post meta), Polylang is a lot cruder, storing translations as separate pages & posts (with different URLs!) and simply recording a cross-reference between them.”
“The first issue is easy enough to diagnose: they’ve probably got WPtouch set to use “WordPress Pages” for the menu, which obviously just dumps everything out
Unlike WPML, which switches the contents of the menu items for the language you’re using, Polylang requires that you manually maintain separate menus for each language. We would have to completely rewrite sections of our menu module to allow customers to pick which menu is for which language. [Which is not in our current future plans.]”
So probably better stay away from either WPtouch or Polylang if you wanna run a multilingual WordPress site.
I found a solution, but it is neither very sophisticated nor very elegant. It works though.
What I did (I currently have a German and English version):
1. I created the German and the English mobile menu in WordPress.
2. I selected the German menu as primary menu in WPtouch settings. Then opened the mobile page, opened page source code of the rendered page and copied the html-code of the menu (“<ul class="menu-tree parent-links"><li class="menu-item ........./li></ul>
“) to an empty text file.
3. Same as step 2 with the English menu.
4. I edited the header-bottom.php file in the WPtouch child theme:
Commented out line 3
<?php /* if ( wptouch_has_menu( 'primary_menu' ) ) { wptouch_show_menu( 'primary_menu' ); } */ ?>
and added instead
<?php if('de' == pll_current_language()) { ?>
"THE COPIED GERMAN HTML CODE"
<?php } else { ?>
"THE COPIED ENGLISH HTML CODE"
<?php } ?>
Now the menus are hardcoded into the template. If you want to change/update the menus you have to follow the above steps again, which in my case takes less than five minutes and my menus won’t change very often.
Just for the record the reply from WProuch Pro support on my workaround (nice guys)
Hi Michael,
As you have identified, manually adding menus with conditional display based on the active language is an option. We are generally reluctant to provide customers with solutions that rely on such hard-coded output, as it can tend to cause problems in future should they choose to update their normally dynamic content (e.g., menus).
That said, thank you very much for your feedback.
That’s the pro support (in case you wanna pay for it)