PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Internationalization » Translation2 » Bug #3149

XML container does not properly handle redundant strings

Details

Submitted2005-01-10 12:19 UTC
Fromylf at xung dot org
Assignedquipo
StatusClosed
PackageTranslation2
PHP Version4.3.4
OSLinux Debian (testing)
Roadmaps(Not assigned)

Comments

[2005-01-10 12:19 UTC] ylf at xung dot org

Description:
------------
With a string doublon in the XML data, Translation2 issues notices/warnings and fail to retrieve the corresponding translation.

Reproduce code:
---------------
Test source : http://samalyse.com/ln/0003.php
XML source : http://samalyse.com/ln/0004.php

Expected result:
----------------
EUR : Euro
NZD : New Zealand Dollar

Actual result:
--------------
Notice: Undefined offset: 0 in /usr/share/php/Translation2/Container/xml.php on line 179

Warning: iconv() expects parameter 3 to be string, array given in /usr/share/php/Translation2/Container/xml.php on line 185

Notice: Undefined offset: 1 in /usr/share/php/Translation2/Container/xml.php on line 179

Warning: iconv() expects parameter 3 to be string, array given in /usr/share/php/Translation2/Container/xml.php on line 185
EUR : Euro
NZD :

[2005-01-11 21:06 UTC] ylf at xung dot org

Absolutely not. I made the doublon myself :-) Trouble is that validating against the DTD doesn't detect that kind of thing.

I'm wondering if it wouldn't be nice to have a command line tool to check translation2's xml files. So that you can test them before going online.

[2005-01-23 21:36 UTC] ylf at xung dot org

Here it is !

t2xmlchk checks and validates XML files intended to be
used with the Translation2 internationalization package.
Usage: t2xmlchk <xml filename>

Grab it at : http://samalyse.com/ln/0007.php

First you need to apply dtd_constant.diff, then ensure that you have the latest XML_DTD package, and DTD_Tree 1.1 (not 2.0.0RC2).

Enjoy !

[2005-01-23 21:37 UTC] ylf at xung dot org

(I meant XML_Tree, not DTD_Tree)