<?php
require('/home/mysite/public_html/LanguageDefinition.class.php');
$language='ru'; //you can set this through a session or cookie or whatever
$lng = new LanguageDefinition('lng'); //you need to pass string with the name of the variable
$lng->setBase('/home/mysite/public_html/lang/');
$lng->setLang($language);
//optional, setting debug mode
$lng->setDebug(true);
?>
<pre>
<p>
This data comes from language file:
<?=__('Days')?>
</p>
<p>
This data also comes from the same language file:
<?=__('months')?>
</p>
This will print 'pants', because it isn't defined in our language file
<?=__('pants')?>
</p>
</pre>
<br/>
Output Debug info (prints array containing term 'pants')
<?php print_r($lng->getDebug())?>
|