Project

General

Profile

Actions

Bug #73577

closed

Soft hyphens in xliff files not working

Added by Josef Glatz almost 9 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2016-02-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
xlf
Complexity:
Is Regression:
No
Sprint Focus:

Description

Problem/Description

Adding a soft hyphen in an string within an xliff file is removed after it is processed by TYPO3

ToDo(s)

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

cattura3.png (57.1 KB) cattura3.png Riccardo De Contardi, 2020-05-03 17:32
cattura4.png (47.2 KB) cattura4.png Riccardo De Contardi, 2020-05-03 17:33
cattura2.png (45 KB) cattura2.png Riccardo De Contardi, 2020-05-03 17:35
cattura5.png (54.5 KB) cattura5.png Riccardo De Contardi, 2020-05-03 17:36
Actions #1

Updated by Georg Ringer about 5 years ago

  • Status changed from New to Needs Feedback

can't reproduce that in current master?!

Actions #2

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 &#173; &#173; &#173; &#173; 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 &#173; is present

Is this sufficient? Am I forgetting something? Or a different test is necessary?

Actions #3

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 &#173;?

Actions #4

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

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 &#173; This is test 1</source>
    </trans-unit>

    <trans-unit id="page.label.mylabeltest2" xml:space="preserve">
        <source>This is test 2 &#173; This is test 2 </source>
    </trans-unit>

    <trans-unit id="page.label.mylabeltest3" xml:space="preserve">
        <source>This is test 3 &#173; This is test 3</source>
    </trans-unit>

    <trans-unit id="page.label.mylabeltest4" xml:space="preserve">
        <source>This is test 4 &#173; 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 &#173; 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> 

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 &#173; with &amp;shy; in this way:

    <trans-unit id="page.label.mylabeltest1" xml:space="preserve">
        <source>This is test 1 &amp;shy; This is test 1</source>
    </trans-unit>

    <trans-unit id="page.label.mylabeltest2" xml:space="preserve">
        <source>This is test 2 &amp;shy; This is test 2 </source>
    </trans-unit>

    <trans-unit id="page.label.mylabeltest3" xml:space="preserve">
        <source>This is test 3 &amp;shy; This is test 3</source>
    </trans-unit>

    <trans-unit id="page.label.mylabeltest4" xml:space="preserve">
        <source>This is test 4 &amp;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 &#173; using &shy; using &amp;shy;
<f:translate key="page.label.mylabeltest1"  />
frontend:seems correct
inspect element:seems correct
parser error : Entity 'shy' not defined frontend: visible '&shy;' string
inspect element: visible '&shy;' string
{f:translate(key:'page.label.mylabeltest2')}
frontend:seems correct
inspect element:seems correct
parser error : Entity 'shy' not defined frontend: visible '&shy;' string
inspect element: visible '&shy;' 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?

Actions #6

Updated by leon jänicke over 1 year ago

  • Tags set to xlf
Actions #7

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

Actions

Also available in: Atom PDF