14-Aug-2012, 07:38 AM
Hi,
Because I'm running a multilingual website, configuring Commentics to use one pre-configured language was not an option. Installing Commentics multiple times neither.
So I introduced a cmtx configuration variable that can "force" a language depending on the language selected on my own page.
Code on my page (the $lang variable being the language code in ISO 639-1 ):
Because I'm running a multilingual website, configuring Commentics to use one pre-configured language was not an option. Installing Commentics multiple times neither.
So I introduced a cmtx configuration variable that can "force" a language depending on the language selected on my own page.
Code on my page (the $lang variable being the language code in ISO 639-1 ):
PHP Code:
<?php
switch($lang) {
case "en":
$cmtx_set_language = "english";
break;
case "de":
$cmtx_set_language = "german";
break;
case "fr":
$cmtx_set_language = "french";
break;
}
Added code in includes/variables/set_variables.php :
PHP Code:
<?php
if (isset($cmtx_set_language)) {
$cmtx_temp = $cmtx_set_language;
unset($cmtx_set_language);
global $cmtx_set_language;
$cmtx_set_language = $cmtx_temp;
}