Ask Your Question
1

Maybe bug with plurals and internationalization

asked 2013-11-10 17:09:25 -0500

bluebyte gravatar image

updated 2013-11-11 07:19:12 -0500

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-11-23 14:19:33 -0500

Evgeny gravatar image

This is fixed in the repository.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-11-10 17:09:25 -0500

Seen: 46 times

Last updated: Nov 23 '13