First time here? Check out the FAQ!

Revision history  [back]

Maybe bug with plurals and internationalization

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.

Maybe bug with plurals and internationalization

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. plural works. 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.