From bugzilla-daemon@bugs.koha-community.org Tue Dec 10 15:17:12 2019 From: bugzilla-daemon@bugs.koha-community.org To: koha-bugs@lists.koha-community.org Subject: [Koha-bugs] [Bug 8937] Translation process removes CDATA in RSS XML Date: Sat, 07 Dec 2019 10:42:09 +0000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8047632159673681349==" --===============8047632159673681349== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8937 Bernardo Gonzalez Kriegel changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com --- Comment #7 from Bernardo Gonzalez Kriegel --- (In reply to Victor Grousset/tuxayo from comment #5) > From what I understand, it turns out that regardless of 15395, the main > translation system will still process the file and remove the CDATA. > > So I don't know what would be a decent way to fix this. If one takes a look at the translated file, not all CDATA entries are removed. In EN 'opac-opensearch.tt' for example there are two lines near the begining, $ egrep -n CDATA opac-opensearch.tt 25: <![CDATA[.(removed).]]> 28: In the translated version of the same file we have 25: <![CDATA[[.(removed).]]> 28: .(removed). CDATA is removed but in 'description', not in 'title'! Why one and not the other? Because of C4::TTParser, based on HTML::Parser. treats some tags differently (script, style, xmp, iframe, title, textarea and plaintext), see https://metacpan.org/pod/HTML::Parser Anyway, the important thing is that ANY text inside CDATA block is IGNORED by the translation process, whichever the tag, and I was not aware of this. To verify this: go to misc/translator, edit a new file 'test.tt' and put inside the lines <![CDATA[ Title ]]> then create a translation file form it ./tmpl_process3.pl create -i ./ -f test.tt -s test.po 'test.po' will have nothing to translate! Change the contents of 'test.po' to Title Description and repeat, rm test.po; ./tmpl_process3.pl create -i ./ -f test.tt -s test.po 'test.po' has now strings to translate. Other rss files, 'opac-news-rss.tt' for example, do not use CDATA at all. Question: Can we remove CDATA blocks from this files? It's the only 'fix' that I can think of. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. --===============8047632159673681349==--