TYPO3流体平移视图辅助对象:使用";%时无输出0A%0A“;在xlf文件中
在我的流体模板中,我正在使用TYPO3流体平移视图辅助对象:使用";%时无输出0A%0A“;在xlf文件中,typo3,fluid,Typo3,Fluid,在我的流体模板中,我正在使用 {f:translate(键:'LLL:path/to/file/locallang.xlf:Test',参数:{0:Test'})} 阳性测试用例 locallang.xlf的内容: <?xml version="1.0" encoding="UTF-8"?> <xliff version="1.0"> <file source-language="en" datatype="plaintext" original="mess
{f:translate(键:'LLL:path/to/file/locallang.xlf:Test',参数:{0:Test'})}
阳性测试用例
locallang.xlf的内容:
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2016-12-06T14:00:00Z" product-name="">
<header/>
<body>
<trans-unit id="Test" xml:space="preserve">
<source><![CDATA[mailto:info@example.org?Subject=%1$s&Body=Hello%0A]]></source>
</trans-unit>
</body>
</file>
</xliff>
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2016-12-06T14:00:00Z" product-name="">
<header/>
<body>
<trans-unit id="Test" xml:space="preserve">
<source><![CDATA[mailto:info@example.org?Subject=%1$s&Body=Hello%0A%0A]]></source>
</trans-unit>
</body>
</file>
</xliff>
阴性测试用例
locallang.xlf的内容:
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2016-12-06T14:00:00Z" product-name="">
<header/>
<body>
<trans-unit id="Test" xml:space="preserve">
<source><![CDATA[mailto:info@example.org?Subject=%1$s&Body=Hello%0A]]></source>
</trans-unit>
</body>
</file>
</xliff>
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2016-12-06T14:00:00Z" product-name="">
<header/>
<body>
<trans-unit id="Test" xml:space="preserve">
<source><![CDATA[mailto:info@example.org?Subject=%1$s&Body=Hello%0A%0A]]></source>
</trans-unit>
</body>
</file>
</xliff>
字符“%”应转义为“%”,如中所述 这导致了
<source><![CDATA[mailto:info@example.org?Subject=%1$s&Body=Hello%%0A%%0A]]></source>
而不是
<source><![CDATA[mailto:info@example.org?Subject=%1$s&Body=Hello%0A%0A]]></source>