<?php
$thisPath = dirname(__FILE__).'/';
require_once dirname( $thisPath ).'/icI18n.class.php' ;
///set path for langs
icI18nLanguage::setBasePath($thisPath.'langs');
//we want translations in german language - doesnt matter for this example really :)
$culture = 'de';
$oLang = new icI18nLanguage($culture);
//first time pick translations from php files inside pages dir
if ($oLang->isEmpty())
{
echo '<br />Load all tokens which need to be translated from files.<br />';
$oLang->findAllTranslationStrings($thisPath.'pages');
$oLang->toFile();
}
$trans = $oLang->getTranslations();
//output all translations on screen
print_r($trans);
echo '<br /><br /><br />';
echo 'If you want to edit translations go to '.($thisPath.'langs/'.$culture.'.xml').' edit xml file and than clear '.
($thisPath.'langs/cache').' directory';
|