[TYPO3-mvc] extbase - translate label for other language

Krystian Szymukowicz k.szymukowicz at gmail.com
Tue Feb 4 12:54:26 CET 2014


W dniu 2014-02-04 11:09, Viktor Livakivskyi pisze:
> Hi, Krystian.
>
> Ah, I see the problme now. We've faced it one time in former project and
> also found no easy way to do this.
> The solution was dirty: store current language, set
> $GLOBALS['TSFE']->config['config']['language'] to desired language,
> re-init LocalizationUtility, render template with language labels,
> re-store original language and re-init LocalizationUtility once again.

Tnx.

What do you mean by "re-init LocalizationUtility"?
All methods there are protected except ::translate.

and there is early return in initializeLocalization() after first use of 
::translate

static protected function initializeLocalization($extensionName) {
		if (isset(self::$LOCAL_LANG[$extensionName])) {
			return;
		}

So changing $GLOBALS['TSFE']->config['config']['language'] gives no effect.

I already tried this.


--
grtz
Krystian


More information about the TYPO3-project-typo3v4mvc mailing list