[TYPO3-dev] Overwriting default language in template
Jan Bednarik
info at bednarik.org
Thu Aug 25 10:41:07 CEST 2011
Hi Alain,
quick look at the pi_getLL function gives an answer:
$this->LOCAL_LANG[$this->LLkey][$key]
so you just need to change $this->LLkey for a while and that's it.
Jan
Dne 25.8.2011 9:17, Alain Gaymard napsal(a):
> Hello
>
> I've got a website running in many languages. In each branch I've
> defined the language in templates (+ext). For instance
>
> config.language = de
>
> and
>
> config.language = en
>
> In an extension I need to display a english content on a german page or
> a german content on an english page using locallang.php and a template.
>
> $this->pi_loadLL();
> // [...] template loaded, TemplateParts initialised
> $MarkerArray = array();
> $SubpartsArray = array();
> $MarkerArray['###HELLO###'] = $this->pi_getLL("hello","[ml]hello").';
> $ouput = $this->cObj->substituteMarkerArrayCached(
> $this->TemplateParts['subscribemail'],
> $MarkerArray,
> $SubpartsArray, array());
>
> Is there a way to temporary change the language used to generate the
> template output in the extension? I presume it is config.language that
> is used to decide which language to use in pi_getLL().
>
> Thanks in advance
More information about the TYPO3-dev
mailing list