Issue Feature Closed

#67909Add a hook to DataHandler - localize - translateToMessage

Goran Medakovic 07/04/15, 10:41 updated 10/17/17, 23:31

Description

By adding a new hook to the localize function, translateToMessage processing we would be able to use external translation services and speed-up translation of the content and even add a custom transliteration functions that would handle various content transformations. I’ve already created an extension that uses this successfully.

Attaching a hook from extension would be as easy as (ext_localconf.php) :
$GLOBALS[‘TYPO3_CONF_VARS’][‘SC_OPTIONS’][‘t3lib/class.t3lib_tcemain.php’][‘processTranslateToClass’][] = ‘EXT:yourextension/class.tx_yourextension_tcemain.php:tx_yourextension_tcemain’

and then in the extension class:

class tx_yourextension_tcemain {
   function processTranslateTo_copyAction(&$content, $lang) {
        // Do something with content (translate, transliterate etc)
   }
}

Patch is attached.

Reviews 1