qTranslate-X – Get the current language code

qTranslate-X – Get the current language code

Wordpress

For those of you who use the qTranslate-X plugin for WordPress, there is a snippet with which you can get the code of the current language.

if (qtranxf_getLanguage() == 'en') {
// insert the code for English here
} elseif (qtranxf_getLanguage() == 'he') {
// insert the code for Hebrew here
}

You can see the language code in the “Languages” tab in the plugin’s settings.