Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.18.2

Bug #17392 bugs in toWords function for hungarian translation
Submitted: 2010-05-12 20:53 UTC
From: matyi52 Assigned: ifeghali
Status: Closed Package: Numbers_Words (version 0.16.2)
PHP Version: Irrelevant OS: GNU/Linux
Roadmaps: (Not assigned)    

 [2010-05-12 20:53 UTC] matyi52 (Mátyás Somfai)
Description: ------------ Two things: 1.: The word for the minus sign has to be written differently, and separated with a space from the number. 2.: In hugarian, if the absolute value of a number is greater than 2000, than each thousand exponents has to be separated by a '-' sign. Test script: --------------- echo "<br/>".iconv('ISO-8859-2', 'UTF-8', Numbers_Words::toWords(-40000, "hu_HU")); echo "<br/>".iconv('ISO-8859-2', 'UTF-8', Numbers_Words::toWords(1016, "hu_HU")); echo "<br/>".iconv('ISO-8859-2', 'UTF-8', Numbers_Words::toWords(3016, "hu_HU")); echo "<br/>".iconv('ISO-8859-2', 'UTF-8', Numbers_Words::toWords(47563, "hu_HU")); echo "<br/>".iconv('ISO-8859-2', 'UTF-8', Numbers_Words::toWords(4790530, "hu_HU")); Expected result: ---------------- Mínusz negyvenezer egyezertizenhat háromezer-tizenhat negyvenhétezer-ötszázhatvanhárom négymillió-hétszázkilencvenezer-ötszázharminc Actual result: -------------- Minusznegyvenezer egyezertizenhat háromezertizenhat negyvenhétezerötszázhatvanhárom négymillióhétszázkilencvenezerötszázharminc


 [2010-05-12 20:54 UTC] matyi52 (Mátyás Somfai)
 [2010-05-14 15:58 UTC] kouber (Kouber Saparev)
-Status: Open +Status: Analyzed
Thank you Mátyás, It would be nice if you can provide also a Hungarian unit test, so that we can verify such language specific rules in the future. See these for an example: Concerning the fix you provided, it needs to follow the parent's method signature. See bug #12512, for details.
 [2010-05-17 15:15 UTC] matyi52 (Mátyás Somfai)
 [2010-05-17 15:26 UTC] matyi52 (Mátyás Somfai)
I uploaded a hungarian unit test as a patch file to an empty file. "Concerning the fix you provided, it needs to follow the parent's method signature. See bug #12512, for details." In this case, the method in the parent class has fewer parameters than in the patch provided by me, so using cweiske's words from the bug #12512: OK: parent: toWords($param1) child: toWords($param1, $param2) I can modify the patch to use the same signature as the parent class, if you want, but I think it is not neccessary.
 [2010-08-20 17:02 UTC] ifeghali (Igor Feghali)
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: ifeghali
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. files were converted to UTF-8.