Feature #67909

Add a hook to DataHandler - localize - translateToMessage

Added by Goran Medakovic over 6 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2015-07-04
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:

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.


Files

processTranslateToClass.diff (1.14 KB) processTranslateToClass.diff Goran Medakovic, 2015-07-04 10:41

Related issues

Related to TYPO3 Core - Bug #84844: Additional parameter(record field) needed for processTranslateTo_copyAction functionClosedRicky Mathew2018-04-24

Actions

Also available in: Atom PDF