Bug #73577
closedSoft hyphens in xliff files not working
0%
Description
Problem/Description¶
Adding a soft hyphen in an string within an xliff file is removed after it is processed by TYPO3
ToDo(s)¶
- Allow soft hyphens https://en.wikipedia.org/wiki/Soft_hyphen in xliff/xml language files
Acceptance Criteria¶
- An soft hyphen added to an translated string is rendered correctly after processed by TYPO3
Info¶
Adding a soft hyphen in e.g. the page title within flexform works.
Files
Updated by Georg Ringer about 5 years ago
- Status changed from New to Needs Feedback
can't reproduce that in current master?!
Updated by Riccardo De Contardi about 5 years ago
I tried the following test with TYPO3 9.5.9
1) On a locallang.xlf I added some soft hypens, e.g.:
<trans-unit id="page.label.mylabel" xml:space="preserve"> <source>Lorem Ipsum ­ ­ ­ ­ dolor sit amet</source> </trans-unit>
2) Label is retrieved using fluid:
<f:translate key="page.label.mylabel" />
3) Cleared all caches;
4) Visited the frontend
Results:¶
- with Chrome's inspector, the character ­
is present
Is this sufficient? Am I forgetting something? Or a different test is necessary?
Updated by Jonas Eberle almost 5 years ago
I've tested with v9 in November and and they were escaped and rendered.
I rendered with <f:translate key="page.label.mylabel" />
Should it have worked with ­
?
Updated by Riccardo De Contardi almost 5 years ago
- Status changed from Needs Feedback to New
I will repeat my test, maybe it was insufficient- in the meanwhile, I put this one on "new". Thanks.
Updated by Riccardo De Contardi over 4 years ago
- File cattura3.png cattura3.png added
- File cattura4.png cattura4.png added
- File cattura2.png cattura2.png added
- File cattura5.png cattura5.png added
I tried to perform a test with 10.4.2-dev:
1) I use 4 separate strings, this is the fluid part:
<p>Test 1 standard: <f:translate key="page.label.mylabeltest1" /> </p> <p>Test 2 inline: {f:translate(key:'page.label.mylabeltest2')}</p> <p>Test 3 standard, format:raw: <f:format.raw><f:translate key="page.label.mylabeltest3" /></f:format.raw></p> <p>Test 4 inline, format:raw: {f:translate(key:'page.label.mylabeltest4')->f:format.raw()}</p>
this is the xliff part:
<trans-unit id="page.label.mylabeltest1" xml:space="preserve"> <source>This is test 1 ­ This is test 1</source> </trans-unit> <trans-unit id="page.label.mylabeltest2" xml:space="preserve"> <source>This is test 2 ­ This is test 2 </source> </trans-unit> <trans-unit id="page.label.mylabeltest3" xml:space="preserve"> <source>This is test 3 ­ This is test 3</source> </trans-unit> <trans-unit id="page.label.mylabeltest4" xml:space="preserve"> <source>This is test 4 ­ This is test 4</source> </trans-unit>
Results:¶
in Chrome, this is the frontend
in Chrome > dev tools (inspect element) this is the result:
additional test 1¶
I tried to replace ­
with ­
in this way:
<trans-unit id="page.label.mylabeltest1" xml:space="preserve"> <source>This is test 1 ­ This is test 1</source> </trans-unit> <trans-unit id="page.label.mylabeltest2" xml:space="preserve"> <source>This is test 2 ­ This is test 2 </source> </trans-unit> <trans-unit id="page.label.mylabeltest3" xml:space="preserve"> <source>This is test 3 ­ This is test 3</source> </trans-unit> <trans-unit id="page.label.mylabeltest4" xml:space="preserve"> <source>This is test 4 ­ This is test 4</source> </trans-unit>
but I got an error:
(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception PHP Warning: simplexml_load_string(): Entity: line 15: parser error : Entity 'shy' not defined in /Users/riccardo/TYPO3-dists/typo3_master/typo3/sysext/core/Classes/Localization/Parser/AbstractXmlParser.php line 78
This is valid for all the four strings.
additional test 2¶
I tried to replace ­
with &shy;
in this way:
<trans-unit id="page.label.mylabeltest1" xml:space="preserve"> <source>This is test 1 &shy; This is test 1</source> </trans-unit> <trans-unit id="page.label.mylabeltest2" xml:space="preserve"> <source>This is test 2 &shy; This is test 2 </source> </trans-unit> <trans-unit id="page.label.mylabeltest3" xml:space="preserve"> <source>This is test 3 &shy; This is test 3</source> </trans-unit> <trans-unit id="page.label.mylabeltest4" xml:space="preserve"> <source>This is test 4 &shy; This is test 4</source> </trans-unit>
and these are the results:
On the frontend:
Inspect element:
To sum it up¶
fluid code | using ­ |
using ­ |
using &shy; |
---|---|---|---|
<f:translate key="page.label.mylabeltest1" /> |
frontend:seems correct inspect element:seems correct |
parser error : Entity 'shy' not defined | frontend: visible '­' string inspect element: visible '­' string |
{f:translate(key:'page.label.mylabeltest2')} |
frontend:seems correct inspect element:seems correct |
parser error : Entity 'shy' not defined | frontend: visible '­' string inspect element: visible '­' string |
<f:format.raw> <f:translate key="page.label.mylabeltest3" /> </f:format.raw> |
frontend:seems correct inspect element:seems correct |
parser error : Entity 'shy' not defined | frontend:seems correct inspect element:seems correct |
{f:translate(key:'page.label.mylabeltest4')->f:format.raw()} |
frontend:seems correct inspect element:seems correct |
parser error : Entity 'shy' not defined | frontend:seems correct inspect element:seems correct |
Did I miss something or a different kind of test is necessary?
Updated by Riccardo De Contardi 5 months ago
- Status changed from New to Closed
I think it is safe to close this issue for now - The behavior I described on my test should be the intended one and no advancement or complain have arisen since then (4 years)
If you think that this is the wrong decision or think that there is still work to do on this topic, please open a new issue that describes the behavior and the indended one and reference this one.
Thank you