Issues

ZF-7460: Zend_Translate, Plural - not return the correct index in the Russian language

Issue Type: Bug Created: 2009-08-03T13:14:27.000+0000 Last Updated: 2009-08-07T12:30:21.000+0000 Status: Resolved Fix version(s): - 1.9.1 (11/Aug/09)

Reporter: Demphest Gorphek (demphest) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments:

Description

I think incorrectly returns index, the Russian language.

If: {quote} 'comment' => array ( 'singular', 'singular, declension', 'plural' ) {quote}

False is returned if the index number of the unit at the end (except 11) {quote} $ 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; {quote} Outputs: 0 plural 1 plural 2 singular, declension

Should be: 0 plural 1 singular 2 singular, declension

Changes to work correctly, line 137: instead {quote} return (($ number% 10 == 1) & & ($ number% 100! = 11))? 0: (($ number% 10> = 2) & & ($ number% 10 <= 4) & & (($ number% 100 <10) | | ($ number% 100> = 20)))? 1: 2; {quote} need {quote} return (($ number% 10 == 1) & & ($ number% 100! = 11))? 0: (($ number% 10> = 2) & & ($ number% 10 <= 4) & & (($ number% 100 <10) | | ($ number% 100> = 20)) 1: 2); {quote} ")))? 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 :)

Comments

Posted by Thomas Weidner (thomas) on 2009-08-07T12:30:21.000+0000

Fixed with r17438

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts