Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.0
-
Fix Version/s: 1.9.1
-
Component/s: Zend_Translate
-
Labels:None
Description
I think incorrectly returns index, the Russian language.
If:
'comment' => array (
'singular',
'singular, declension',
'plural'
)
False is returned if the index number of the unit at the end (except 11)
$ l = 'ru';
echo
0, '', $ translate-> translate (array ( 'comment', 'comments', 0), $ l), PHP_EOL,
1, '', $ translate-> translate (array ( 'comment', 'comments', 1), $ l), PHP_EOL,
2, '', $ translate-> translate (array ( 'comment', 'comments', 2), $ l), PHP_EOL;
Outputs:
0 plural
1 plural
2 singular, declension
Should be:
0 plural
1 singular
2 singular, declension
Changes to work correctly, line 137:
instead
return (($ number% 10 == 1) & & ($ number% 100! = 11))? 0: (($ number% 10> = 2) & & ($ number% 10 <= 4) & & (($ number% 100 <10) | | ($ number% 100> = 20)))? 1: 2;
need
return (($ number% 10 == 1) & & ($ number% 100! = 11))? 0: (($ number% 10> = 2) & & ($ number% 10 <= 4) & & (($ number% 100 <10) | | ($ number% 100> = 20)) 1: 2);
")))? 1: 2;" >> transfer bracket ")) 1: 2); "
Simply transfer the closing parenthesis at the end of the expression.
Tested for release 5.3.0
P/S: Sorry for my english ![]()
Fixed with r17438