Sunday 05 December 2010 10:04:05 pm
Hello eZ riders, My question is very simple yet i did not find the right resource. I need to translate text in a php module using the same mechanism as the i18n operator but i can't find the way to make this code work properly :
$language = ezcurrentLanguage();
if ( $language != "eng-GB" )
{
$file = 'translation.ts';
$ini = eZINI::instance();
$useCache = $ini->variable( 'RegionalSettings', 'TranslationCache' ) != 'disabled';
eZTSTranslator::initialize( $context, $language, $file, $useCache );
$man = eZTranslatorManager::instance();
$newValue = $man->translate( $context, $value, $comment );
if ( $newValue )
{
$value = $newValue;
} Thanks
-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney
|