1
For a couple of days, I've been seraching for a way to make a them multilingual. Certain strings in theme always need to be converted if you want it in french for example. Now I have a bilingual site (english and french) and have installed the MLPath. I also needed the theme to be in the language the user shows.
I found a way to do it so I post it here. It works, but I don't know if it is the good way to do it (I'm not a coder so I can't know...)
For example, the theme 7dana-clean greats the user when he signs in by a line at the top of the theme that says:
Quote:
Hello 'username' your account
I needed that to be translated. I also needed the Search button to be translated. So, at the the top of the them.html file for that theme, I've inserted this code :
<{php}>
global $myts;
$myts =& MyTextSanitizer::getInstance();
$GLOBALS['xoopsTpl']->assign('ello',$myts->makeTboxData4Show("[fr]Bonjour[/fr][en]Hello[/en]"));
$GLOBALS['xoopsTpl']->assign('youraccount',$myts->makeTboxData4Show("[fr]Votre compte[/fr][en]Your account[/en]"));
$GLOBALS['xoopsTpl']->assign('search',$myts->makeTboxData4Show("[fr]Recherche[/fr][en]Search[/en]"));
<{/php}>
Then I put the variables where they would be needed, like this for example :
<td class="pozdrav"> <{if $xoops_isuser}><{$ello}> <a href="<{$xoops_url}>/user.php"><{$xoops_uname}>a> <a href="<{$xoops_url}>/user.php"><{$youraccount}>
If there is a better way to do this, please post it...
Regards !