Does not get language from contents
-
Hi,
thanks for a really nice plugin. It did its job as expected until we upgraded our site to the newer WordPress version (and newer plugin version). Its configuration did not change it’s still fairly simple: http://snag.gy/do2Bm.jpg, http://snag.gy/T0Vnv.jpg, http://snag.gy/Wehnx.jpg. The theme we are using is our own piece of code, based on html5blank. It seems to be correct in terms of wp_nav_menu/theme_location usage: http://snag.gy/0iLo0.jpg.
But the problem is, as you might have already guessed, it does not work 🙁 English version http://snag.gy/MEUSr.jpg has the same menu as Polish http://snag.gy/VkvDG.jpg.
I have checked and
lang
tag inhtml
header is always set to “pl-PL”, even on English pages like this one: http://lectorium.edu.pl/how-to-add-to-the-repository/.What am I missing? Could you please point me out?
cheers
-
Hi
Could you please deactivate all your plugins and test with your theme + only Polylang?
If it works, reactivate your plugins one by one to find which is causing the issue.Thanks for quick reply. I didn’t write, but I had already tested that option – deactivated all plugins but Polylang and checked site in „fresh” browser (with all history, cache, cookies cleared). Unfortunately it did not help.
Did you test with a default theme as Twenty Sixteen and only Polylang? Does it work?
Yes, tested with Twenty Sixteen and Twenty Twelve.
And which is the result?
Did not work. “pl-PL” set each time in
html
‘slang
attribute and Polish only menus 🙁I tested with Polylang 1.8.4 + Twenty Sixteen 1.1 + WordPress 4.4.2 and it works.
How did you make your updates, by your WordPress admin interface or by the FTP?
We did it via admin interface.
All right, I got some debugging information (at last 🙂 )
Notice: Undefined index: wp_the_query in /srv/www/wordpress/lectorium/wp-content/plugins/polylang/frontend/choose-lang-content.php on line 83
Have you got any idea what might be wrong?
Thanks for the notice. In fact the language is not defined on your site. Have you also this notice with Twenty Sixteen + *only Polylang*?
I have just made a test you asked for. I have disabled every plugin, but Polylang and switched to Twenty Sixteen template. Here is how the page looks in Polish: http://snag.gy/s43jM.jpg, and English: http://snag.gy/Uzuos.jpg. Unfortunately the menus do not change.
Could you test with the “The language is set from the directory name in pretty permalinks” option?
Still no luck, even with “The language is set from the directory name in pretty permalinks”.
I’ve installed a debugging plugin and checked “Request”. For Polish page (http://lectorium.edu.pl/pl/) some parts of it look like that:
[query_vars] => Array ( [lang] => pl [debug-this] => request ) [query_string] => lang=pl&debug-this=request [request] => pl [matched_rule] => (pl|en)/?$ [matched_query] => lang=pl [did_permalink] =>
For English page (http://lectorium.edu.pl/en/) this part looks like this:
[query_vars] => Array ( [lang] => en [debug-this] => request ) [query_string] => lang=en&debug-this=request [request] => en [matched_rule] => (pl|en)/?$ [matched_query] => lang=en [did_permalink] =>
Would that help?
Hi Mateusz,
I don’t use Polylang for a long time, so I don’t know if anything changed, but I noticed that I have to define menu for every language I have on the site (under Appearance > Menus). And every menu has to link to proper pages/posts (ie. in the language of the menu). In other words, Polylang does not seem to translate navigational menu items for you – Chrystl, can you confirm?
I think you might have the same problem on your site (despite that my site has html lang attribute set correctly). Try to create one menu for Polish (with Polish pages) and assign it to Primary Menu Polish position (or what’s your theme name for the menu position). Then do the same for English.
Greetings,
Czesław@chesio
Hi
In fact it’s not a menu problem. The problem it seems that any time the language is defined by Polylang.@mateuszn
Could you go in Debug this (top admin bar) > Php > Variables: for the_SERVER
part I want to see only the line[PHP_SELF] =>
.
Please don’t show other informations, since they are relative to your installation. Keep them private.
- The topic ‘Does not get language from contents’ is closed to new replies.