Project

General

Profile

Actions

Bug #91301

closed

Wrong encoding for "displayResults"

Added by Gerhard Rupp over 4 years ago. Updated 6 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Localization
Target version:
-
Start date:
2020-05-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:
Remote Sprint

Description

As some values in locallang.xlf file contain entities for angle brackets these have to be decoded before frontend rendering in partial Search.html

F. e.

<is:pageBrowsingResults numberOfResults="{result.count}" currentPage="{searchParams.pointer}" resultsPerPage="{searchParams.numberOfResults}" />

should be wrapped with format.htmlentitiesDecode ViewHelper

<f:format.htmlentitiesDecode><is:pageBrowsingResults numberOfResults="{result.count}" currentPage="{searchParams.pointer}" resultsPerPage="{searchParams.numberOfResults}" /></f:format.htmlentitiesDecode>

Files


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #91386: Indexed_search invalid translation string in DEClosed2020-05-13

Actions
Actions #1

Updated by Benni Mack over 4 years ago

Hey Gerhard,

I tried to reproduce this issue with TYPO3 v10.4.1 - but without success.. maybe the change in issue #90484 already solves your issue. Can you try again with TYPO3 v9.5.17 ?

Actions #2

Updated by Gerhard Rupp over 4 years ago

Error still exists in 9.5.17 but seems to be caused by the already encoded value in the German language file.

locallang.xlf

<trans-unit id="displayResults" resname="displayResults">
  <source><![CDATA[Displaying results <strong>%1$s to %2$s</strong> out of <strong>%3$s</strong>]]></source>
</trans-unit>

de.locallang.xlf

<trans-unit id="displayResults" resname="displayResults" approved="yes">
  <source><![CDATA[Displaying results <strong>%1$s to %2$s</strong> out of <strong>%3$s</strong>]]></source>
  <target state="final"><![CDATA[Anzeige der Ergebnisse &lt;strong&gt;%1$s bis %2$s&lt;/strong&gt; von insgesamt &lt;strong&gt;%3$s&lt;/strong&gt;]]></target>
</trans-unit>
Actions #3

Updated by Georg Ringer over 4 years ago

this is a problem during the crowdin migration. detailed report

Original file having cdata + tags
```<source><![CDATA[Displaying results <strong>%1$s to %2$s</strong> out of <strong>%3$s</strong>]]></source>```
the export I did from pootle had this
```<trans-unit id="displayResults" resname="displayResults" approved="yes">
                <source>Displaying results <strong>%1$s to %2$s</strong> out of <strong>%3$s</strong></source>
                <target state="translated">Anzeige der Ergebnisse <strong>%1$s bis %2$s</strong> von insgesamt <strong>%3$s</strong></target>
            </trans-unit>```
so no cdata for the source and no cdata on the target + using `<` instead of `<`.

I uploaded those files to crowdin and now there seems to be some magic happening.
I *guess* you match now the source of the file also to the real source language provided previously.
However, now the source contains cdata + proper tags which is fine *but* the translations now contain cdata as well but still the original translation which is now escaped and wrong

```<trans-unit id="displayResults" resname="displayResults" approved="yes">
<source><![CDATA[Displaying results <strong>%1$s to %2$s</strong> out of <strong>%3$s</strong>]]></source>
<target state="final"><![CDATA[Anzeige der Ergebnisse <strong>%1$s bis %2$s</strong> von insgesamt <strong>%3$s</strong>]]></target>
</trans-unit>```
From my side it is wrong to add cdata automatically to the target but leave the content as it is.

Is it correct that I need to fix that myself, also e.g. using the mass replace tool
Actions #4

Updated by Georg Ringer over 4 years ago

  • Has duplicate Bug #91386: Indexed_search invalid translation string in DE added
Actions #5

Updated by Georg Ringer over 4 years ago

  • Category changed from Indexed Search to Localization
  • Status changed from Needs Feedback to Accepted
  • Assignee set to Georg Ringer
Actions #6

Updated by Andreas Krämer over 3 years ago

The DE translation is working in TYPO3 10.4.20.
But the ES translation is still wrong:

<trans-unit id="displayResults" resname="displayResults" approved="yes">
  <source><![CDATA[Displaying results <strong>%1$s to %2$s</strong> out of <strong>%3$s</strong>]]></source>
  <target state="final"><![CDATA[Mostrando resultados &lt;strong&gt;%1$s a %2$s&lt;/strong&gt; de &lt;strong&gt;%3$s&lt;/strong&gt;]]></target>
</trans-unit>

I just fetched it from Crowdin. FR translation is working, too.

For now I "fixed" it this way for ES:

plugin.tx_indexedsearch._LOCAL_LANG.es.displayResults = Mostrando resultados <strong>%1$s a %2$s</strong> de <strong>%3$s</strong>

(https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/TopLevelObjects/Plugin.html#local-lang-lang-key-label-key)

Actions #7

Updated by Mathias Schreiber over 2 years ago

  • Sprint Focus set to Remote Sprint
Actions #8

Updated by Georg Ringer 6 months ago

this has been IMO fixed on crowdin, therefore closing this issue. if still valid, please contact me on slack or open a new issue and reference this one

Actions #9

Updated by Georg Ringer 6 months ago

  • Status changed from Accepted to Closed
Actions

Also available in: Atom PDF