292443
Quote:
This hack works great but what's about translating the story title not just the body content
Actually, it is also easy to
make the Titles multilingual in much the same way as the content, with a simple hack to the same module.textsanitizer.php file. I did a quick look at how the tables are setup and most title fields are limited to 255 characters, so that probably is enough space most of the time for at least 2 languages.
I tested this real quickly here and it seems to work in at least the
news, FAQ, Forum and WF-Sections. I don’t have a lot of other modules installed at the moment on my test site, so I couldn’t test too many others.
The only thing I found that didn't work was the comment titles. Someone might dig around and see if they can find how the comment title is produced.
Toward the bottom of the module.textsanitizer.php file in your class folder, there is a function called
makeTboxData4Show and another one
makeTboxData4Preview. In both of them just before the line:
return $text;you need to add a new line like this:
$text =& $this->xoopsCodeDecode($text, 0);That is it! This forces the titles to go through the XOOPS codedecoder where it will find your original language hack.
Hope this helps!
Chad
Here is what those two functions look like on my computer:
Quote:
function makeTboxData4Show($text, $smiley=0)
{
$text = $this->htmlSpecialChars($text);
$text =& $this->xoopsCodeDecode($text, 0);//added by chad
return $text;
}
function makeTboxData4Preview($text, $smiley=0)
{
$text = $this->stripSlashesGPC($text);
$text = $this->htmlSpecialChars($text);
$text =& $this->xoopsCodeDecode($text, 0);//added by chad
return $text;
}