I was wrote program with use Django 1.3/Google App Engine and find lack of support and strange behavior.
Prapration - Polish translation (could be important)
First of all the ungettext not support Polish directly see but django 1.3 support PO file tag Plural-Forms (many not English languages has multiple plurals) - I do such for Polish language - maybe same will be for Russian:
Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
I put some examples as said before ungettext is useless since Polish has more plural forms than English I used it to extract msgId nothing more
# should be 0 kóz
ungettext(u'%s kóz', u'%s kozy', 0) % 0
# should be 1 koza
ungettext(u'%s kóz', u'%s kozy', 1) % 1
# should be 2 kozy
ungettext(u'%s kóz', u'%s kozy', 2) % 2
# should be 5 kóz
ungettext(u'%s kóz', u'%s kozy', 5) % 5
I was use makemessages.py and translate this with trick to get 3 plural forms not 2 like in English (Polish need 2-3 forms):
msgid "%s kóz"
msgid_plural "%s kozy"
msgstr[0] "%s 1 koza"
msgstr[1] "%s 2 kozy"
msgstr[2] "%s 5 kóz"
Strange behavior of Django (major question)
Now more tricks I do but not understand behavior:
I was set all variable for DJANGO correctly including (hope so) and:
LANGUAGE_CODE = 'pl' - all translation works but not Polish one I have two form not 3. msgid "%s kóz" msgid_plural "%s kozy" msgstr[0] "%s 1 koza" msgstr[1] "%s 2 kozy" msgstr[2] "%s 5 kóz"
LANGUAGE_CODE = 'en' - all translation works (pl, en-us, en-gb, de-de, ...)
LANGUAGE_CODE = 'xx' - all translation works (pl, en-us, en-gb, de-de, ...)
LANGUAGE_CODE = 'en-us' - all translation works (pl, en-us, en-gb, de-de, ...) but not en-us transaltion
Why I should set my language to INVALID 'xx' or other not existing translation to make it working in django it is strange for me? Could you help me how to do it correclty?