Switch Locales in TYPO3, "live", on one page -


on set multiple locales on 1 page enlightened can switch locales in php live, during 1 php call.

for example, this:

    $locale_old = setlocale(lc_time, 0);     setlocale(lc_time, 'fr_ch');     //     setlocale(lc_time, $locale_old); 

what typo3? have different dates on 1 page should displayed in different languages according content element they're in.

as locale renders date set globally, can't done using these 2 typoscript settings:

config.locale_all = de_ch config.locale_all = fr_ch 

is possible @ - , how?

this not possible typoscript, because typoscript not executed line line, rather parsed 1 configuration tree passed frontendcontroller (technical call order other way around, not try inner magics of typo3 here).

so either need define own wrapper script can call @ needed places stdwrap methods or switch fluid templating , create viewhelper switching you. inside viewhelper can use code mentioned in question.

the typoscript setting setlocale() globally. of course can switch while execute own php code. means can switch setting (even in frontendcontroller) inside controller or in view.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -