Created
April 20, 2020 21:37
-
-
Save derekashauer/a6d47b88690c6bd7a9eb27b8968972bd to your computer and use it in GitHub Desktop.
TranslatePress Set Language To Cookie
Thank you.
I think I understood where the problem is.
If I am on a page like: https://mysite.com/it/page, $TRP_LANGUAGE is it_IT.
But if I go to the home page WITHOUT THE SLUG (https://mysite.com) $TRP_LANGUAGE revert to en_US. And the same happens with custom pages.
This means that by default TranslatePress does not remember user last visited language. The sell an add on to do that (didn't knew).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like something to ask the TranslatePress people about, but since that is a non-standard way of doing things in WordPress I don't think they will have much of an answer for you. Might have to dig into the code to see when $TRP_LANGUAGE actually gets set by TranslatePress and find another way to make it work OR do something within normal WordPress.