Hello,
Yes. There are several ways.
* in PHP you can use the $TRP_LANGUAGE global variable
* we also setup a cookie “trp_current_language” with the language that you can access from JS and PHP
* in the body class you’ll find the current language: like so: translatepress-en_US
If there’s anything else, please let me know!
Hi,
I have defined a global variable like
global $TRP_LANGUAGE;
With this variable, when I am doing
echo $TRP_LANGUAGE;
it returning en_US, zh_HK like this. But I need the actual code, which is passing through the url i.e. en, hk like this.
So, can you please help!