1

Maybe bug with plurals and internationalization

  • retag add tags

I'am trying to migrate to the latest version. But faced with a problem:

IndexError at /questions/
list index out of range
Request Method: GET
Request URL:    http://127.0.0.1:8000/questions/
Django Version: 1.4
Exception Type: IndexError
Exception Value:    
list index out of range
Exception Location: /Users/bluebyte/projects/test_project/askbot/utils/pluralization.py in py_pluralize, line 143
Python Executable:      /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.5

Steps: 1. turn on russian localization 2. add one question

I think there is something wrong with loading plurals. In plurazation.py we decide which form of plural to use. Where are 3 forms in russian language. So, askbot crashes if system decides that we need the third one. In extra_filters_jinja.py in method py_pluralize system passes default english plurals despite settings. But there are just 2 forms in english... So, we get list index out of range error.

I don't understand how plurals work. Need help with fixing that.

Also, there is tiny bug in method py_pluralize in plurazation.py:

if form_number > num_forms:

num_forms starts with 1 and form_number start with 0. So, you should use >= I think.

bluebyte's avatar
65
bluebyte
asked 2013-11-10 17:09:25 -0600, updated 2013-11-11 07:19:12 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

This is fixed in the repository.

Evgeny's avatar
13.2k
Evgeny
answered 2013-11-23 14:19:33 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments