First time here? Check out the FAQ!
1

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
bluebyte's avatar
65
bluebyte
asked 11 years ago, updated 11 years ago

Comments

see more comments

1 Answer

0

This is fixed in the repository.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago
link

Comments

see more comments