[TYPO3-mvc] Newline in XLIFF language files
Thomas Hucke
thucke at web.de
Mon Mar 4 19:33:59 CET 2013
Hallo Xavier,
puh - that was absolutely perfect background information. Thank you a lot!
Unfortunately regardless of the spaces and linefeeds in the resulting source
code the output was still one line.
My analysis brought me to a solution.
I seemed to me that I have to use the html tag <br/> to force linebreaks in
my output. But obviously the argument htmlEscape="false" did not work.
I figured out that already the parser filtered all html tags in my XLF file.
Found that standard PHPs SimpleXMLElement is used to parse all XML files - a
shot google search was a heart shot.
My original XLF entry was
<trans-unit id="fluid.layout.default.anonymousVoting"
xml:space="preserve" approved="yes">
<note>Forwarded arguments: None</note>
<source>Your are an anonymous user.<br/>You may log on to do
personalized votings<br/>></source>
</trans-unit>
Now I figured out that I have to put my entry into CDATA section:
<trans-unit id="fluid.layout.default.anonymousVoting"
xml:space="preserve" approved="yes">
<note>Forwarded arguments: None</note>
<source><![CDATA[Your are an anonymous user.<br/>You may log on to do
personalized votings<br/>]]></source>
</trans-unit>
Then using htmlEscape="false" in my template all works as I wanted.
BTW: I´m using Typo3 4.7
Perhaps someone having a similar challenge stumbles upon this description.
Thank you all
Thomas
"Xavier Perseguers" schrieb im Newsbeitrag
news:mailman.1.1362339246.14027.typo3-project-typo3v4mvc at lists.typo3.org...
Hi,
The Extension Builder does not support it out-of-the-box but the correct
definition of a XLIFF label is:
<trans-unit id="activity_classification.details" xml:space="preserve">
(xml:space="preserve")
Example:
<trans-unit id="activity_classification.details" xml:space="preserve">
<source>The following link shows a table listing national
classifications for which basic information is available:
http://unstats.un.org/unsd/cr/ctryreg/ctrylist2.asp?rg=7
In 1996, the Swiss Federal Statistical Office released a program (KUBB)
to help users of the General Classification of Economic Activities
(NOGA) to find the codes corresponding to a given economical activity.
By entering keywords into the KUBB program's search tool, users are able
to quickly find the exact NOGA code that corresponds to a given activity.
Link to the KUBB 2008 (free):
http://www.kubb2008.bfs.admin.ch/?lang=en</source>
This is the correct way of doing it. Here the example is from a _csh
file, did not check with the Fluid translation VH but if it does not
work, it's a bug that should get fixed.
Kind regards
Thomas Hucke wrote:
> Hi list,
>
> next issue here.
> I need newline in my xlf-files. Tried "<br/>" but this seems to be
> filtered by translate viewhelper.
> Addin htmlEscape="false" doesn´t help there.
>
> How can I define newlines in my language files?
>
> Thanks
> Thomas
--
Xavier Perseguers
Release Manager TYPO3 4.6
TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
More information about the TYPO3-project-typo3v4mvc
mailing list