Getting different page translations from a single URL
-
Hi there,
Chouby, first thanks for the great and powerful plugin! I selected it from all other solutions (including WPML) and it seems to work great and be both simple and flexible. ??
However, there is something I have been unable to achieve yet: I have a proprietary theme (a child theme of Elegant Theme DIVI) generating multiple pages from various data stored in WP tables. I mean that no manual editing is done on such pages, there are completely generated by code.
If relevant, the URLs of these pages follow the following format: “mysite.com/subdir1/subdir2/page_slug”. The default language is english. I am now adding French as a second language and I need to be able to display such pages either in English or French, without modifying the URL across languages. For that, all the strings have been properly prepared for translation in the code with __() and _e() functions, the .po and .mo files have been generated, etc.
I have understood that the current language is set by Polylang from a cookie (or alternatively from the browser language preference setting). So the behavior I would expect and I need is that calling the page “mysite.com/subdir1/subdir2/page_slug” would end in displaying the page either in English or in French, depending on the current language. For example, I also use Buddypress and it automagically displays the user profile in English or French from a single url such as “mysite.com/members/username/”.
However it doesn’t work for my theme. Calling a “mysite.com/subdir1/subdir2/page_slug” page ends in always displaying it in English, whatever the language of the previous visited pages or the browser language preference can be.
What do I miss? How could I make it working?
Many thanks in advance,
Yves.
- The topic ‘Getting different page translations from a single URL’ is closed to new replies.