[TYPO3-project-formidable] renderlet TinyMCE: use page language instead of one fixed (configurated) language
Hauke Hain
newgrp at googlemail.com
Wed Feb 25 16:38:05 CET 2009
Hello,
because I do not know if it is possible to make conditions within the XML,
but wanted the language of the editor the same as the page language, I made
a few adjustments.
In your page TypoScript template you must have some code like this:
[globalVar = GP:L=0]
config {
sys_language_uid = 0
language = en
locale_all = en_GB
htmlTag_langKey = en
}
plugin.meta.language = en
[global] [globalVar = GP:L=1]
config {
sys_language_uid = 1
language = de
locale_all = de_DE
htmlTag_langKey = de
}
plugin.meta.language = de
[global]
Important is, that the language is set to the same code as TinyMCE likes it.
In your XML just set the language to siteSetting:
<renderlet:TINYMCE name="reviewText" label="LLL:reviewForm.review">
<config
width="500"
height="200"
language="siteSetting"
/>
</renderlet:TINYMCE>
Now add to your
ameos_formidable\api\base\rdt_tinymce\api\class.tx_rdttinymce.php
the following lines before
if(is_array($aAddConfig = $this->_navConf("/addconfig")) &&
$this->oForm->isRunneable($aAddConfig)) {
// etc...
}
add these:
if(array_key_exists("language", $aConfig)) {
if ($aConfig["language"] = 'siteSetting') {
$aConfig["language"] =
($GLOBALS['TSFE']->tmpl->setup['config.']['language']);
}
}
If you change this line
$aConfig["language"] =
($GLOBALS['TSFE']->tmpl->setup['config.']['language']);
to
$aConfig["language"] =
($GLOBALS['TSFE']->tmpl->setup['config.'][htmlTag_langKey]);
You read the htmlTag_langKey set in your TypoScript Template instead of
language also set in your TS Template.
I dunno, I'd like to see this functionality in the next formidable version.
:)
One hint:
Of course you have to put all your language packs in the root folder of
TinyMCE. If TinyMCE doesn't find a translation something like
"{desc_to_translate}" will be shown.
Hope it's useful!
Regards,
Hauke
More information about the TYPO3-project-formidable
mailing list