codersrb
codersrb

Reputation: 140

How to switch language in qTranslatex using php

I want to switch the language in qTranslatex plugin using a php

Checkout the below code;

$country = 'US';

if ($country == 'US') {
    //set language english
} else {
    // set language thai
}

Upvotes: 1

Views: 1306

Answers (1)

nektobit
nektobit

Reputation: 951

The easiest way - use global variable:

$country = 'US';

if ($country == 'US') {
    $GLOBALS['q_config']['language'] = 'en';
} else {
    $GLOBALS['q_config']['language'] = 'tl';
}

Upvotes: 3

Related Questions