Some functions on this portal require JavaScript but your browser does not support it or it has been disabled.
Skip to main content
Thursday 23 October 2008 11:57:17 am - 1 reply
Pascal Specht
Friday 24 October 2008 12:09:33 am
If someone faces the same challenge some day, here's how I solved it:
function &translate_to_lang( $context, $source ,$language ) { $ini =& eZINI::instance(); $file = 'translation.ts'; $comment = null; // translation.ts translation $useCache = $ini->variable( 'RegionalSettings', 'TranslationCache' ) != 'disabled'; eZTSTranslator::initialize( $context, $language, $file, $useCache ); $man =& eZTranslatorManager::instance(); $trans = $man->translate( $context, $source, $comment ); if ( $trans !== null ) { $text = ezinsertarguments( $trans, $arguments ); return $text; } eZDebug::writeWarning( "No translation for file(translation.ts) in context($context): '$source' with comment($comment)", "ezi18n" ); $text = ezinsertarguments( $source, $arguments ); return $text; }
You must be logged in to post messages in this topic!