Bug #91301
closed
Wrong encoding for "displayResults"
Added by Gerhard Rupp over 4 years ago.
Updated 6 months ago.
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
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 ?
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 <strong>%1$s bis %2$s</strong> von insgesamt <strong>%3$s</strong>]]></target>
</trans-unit>
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
- Has duplicate Bug #91386: Indexed_search invalid translation string in DE added
- Category changed from Indexed Search to Localization
- Status changed from Needs Feedback to Accepted
- Assignee set to Georg Ringer
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 <strong>%1$s a %2$s</strong> de <strong>%3$s</strong>]]></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)
- Sprint Focus set to Remote Sprint
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
- Status changed from Accepted to Closed
Also available in: Atom
PDF