Nr TextDB
Migration ViewHelper
- In order to migrate LLL file templates to textDB entries the extension provides a
textdb:translateviewhelper - It implements the same interface like the
f:translateviewhelper - so to migrate your translation try the following steps
- Include the textdb viewhelper to your template e.g.
xmlns:textdb="http://typo3.org/ns/Netresearch/NrTextdb/ViewHelpers" - replace
f:translatecalls in your template withtextdb:translatecalls - go to your controller and set the required component e.g.
TranslateViewHelper::$component = 'my-component'; - call your templates/views etc. in frontend
- the
textdb:translateviewhelper will load the current translation 0 as well as the language with uid 1 - it will load the translations from LLL files and insert them to the textDB
- After completed proceed as follows
- reset your template and code changes
- replace your
f:translatecalls withtextdb:textdbcalls by using the following regex with e.g. notepad++
// replace <f:translate stuff
search for => <f:translate key="LLL:EXT:[^:]+:([^\"]+)\"[^>]+>
replace with => <textdb:textdb component="<yourcomponent>" placeholder="\1" type="label" />
// replace for {f:translate stuff
search for => {f:translate\(key: 'LLL:EXT:[^:]+:([^\']+)'\)}
replace with => {textdb:textdb\({placeholder: '\1'\, component : '<yourcomponent>' , type : 'label'})}
Copied!