This issue could perhaps be put in a separate thread, but it's related to the other issue above in a way. For completeness, we'll post it as a reply here.
There appears to be a problem when text with language tags, that is to be parsed by xLanguage, appears in a page immediately before a
tag. What happens is that the
tag is removed, if the current language is not the last language in the language-tagged text.
ie: imagine your output webpage, prior to xLanguage parsing everything, contains this text (pardon my French!):
<p>[en]This is the first line of the paragraph[/en][fr]Ici c'est le premier ligne du 'paragraph'[/fr]
[en]This is the second line[/en][fr]Ici c'est le ligne second[/fr]p>
If English is the current language, then the line break in the middle of that paragraph would be removed by xLanguage.
If French is the current language, then the line break would remain.
I can't think of a good reason for this to be the case, but perhaps it was introduced to handle some kind of special situation.
Unfortunately, this behaviour breaks the page layout, sometimes in significant ways. We uncovered the problem when we noticed that when a form element has a caption and a description, rendered by the xoopsForm class, there is supposed to be a space between the caption and the description. But because of this behaviour of xLanguage, if the caption has language tags in it, then the space between the caption and description is only present when the currently active langauge is the last language present in the text.
It seems most sensible that the parsing of language tags should result in replacements of only the language text, and not any elements of the page layout, including simple line breaks. Since there are bad side effects of this behaviour on the appearance of pages, we recommend it be changed.
I would be interested to know the rationale for including this behaviour though, perhaps there is some important issue we're overlooking.
To change the current behaviour so that line breaks are not affected by language tag parsing, change the following in the include/functions.php file in the xLanguage module:
On line 193 (in xLanguage 3.0), change this:
(\]\
|\])
To this:
\]
Thanks for reading, I look forward to any response.
--Julian