Filling in .po files for translation of phrases with variable content
09:09 30 Jan 2017

I wasn't able to find in the doc, but I have no idea how to translate phrases that contain variable content.

I have the following phrase in my Django view:

apple_count = 100    
a = _('I have %d apples' % apple_count)

After running makemessages, I have the following auto-generated content in .po file:

msgid "I have %d apples"
msgstr ""

I have tried several combinations, like this one:

msgid "I have %d apples"
msgstr "У меня есть %d яблок"

and this one:

msgid "I have apples"
msgstr "У меня есть яблок"

And yet no success - when changing the language to Russian, I still see the phrase in English, rather than Russsian. What I am doing wrong ?

django translation