Home » File Formats » File_Gettext » Bug #4989
Problem dealing with plural
Details
| Request #4989 | Problem dealing with plural |
|---|---|
| Submitted | 2005-08-03 17:32 UTC |
| From | tfpsky at yahoo dot com dot br |
| Status | Suspended |
| Package | File_Gettext |
| PHP Version | 4.3.4 |
| OS | SuSE Linux 9.1 |
| Roadmaps | (Not assigned) |
Comments
[2005-08-03 17:32 UTC] tfpsky at yahoo dot com dot br
Description:
------------
When trying to get plurals from a PO or MO file, they are not being handled properly.
An example of plural entry in PO file would be like the fallow:
msgid "House"
msgid_plural "Houses"
msgstr[0] "Casa"
msgstr[1] "Casas"
The result of a $FILE_Gettext->load($file) and $FILE_Gettext->toArray() is not what expected.
Test script:
---------------
$FILE_Gettext->load($file);
print_r( $FILE_Gettext->toArray() );
Expected result:
----------------
<!-- Something like this -->
array (
[House] => Casa,
[Houses] => Casas
);
Actual result:
--------------
array (
[HouseHouses] => CasaCasas
);
[2005-12-28 21:07 UTC] piotr at szczepanski dot name
It would be nice if it dealt, though...
For PO files, there is an implementation of this in Drupal's _local_import_read_po():
http://cvs.drupal.org/viewcvs/*checkout*/drupal/drupal/includes/locale.inc
But yours PCRE-based would be a lot better.