compilemessages makes i18n crashes

544 Views Asked by At

I have a problem when I run

python manage.py compilemessages

it used to work perfectly fine but today, whenever I do it, i18n won't load on my web pages. I always get the same issue :

    raise ValueError('invalid token in plural form: %s' % value)
ValueError: invalid token in plural form: EXPRESSION

I tried to empty my .po files and to rerun compilemessages, and I still get the error. I have absolutely no other clue where to look for.

Note: when I go back to any former commit, everything will run fine until I run compilemessages

1

There are 1 best solutions below

0
On

in django 1.11 makemessages -l en creates a faulty .po file for en language but for some other languages i have tested it works just fine.

eg. for english - wrong:

"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

and for croatian - ok:

"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"

i have reported this issue here https://code.djangoproject.com/ticket/28709