views:

372

answers:

2

E.g. in my django source I have:

{% blocktrans %}You are a member since {{sincewhen}}{% endblocktrans %}

What should go into the .po file? (django docs don't explain this part as far as I could find)

Is .po format for placeholders universal for use in programs written in different programming languages?

edit: I've tried commands

django-admin.py makemessages -l de -e=html,py
django-admin.py compilemessages

This did not work because of a bug that I found and described here.

After this was fixed I could get the message files generated with the command above (if you have other file extensions - modify -e option accordingly.

+1  A: 

Read this section: Message files

It explains how to generate .po files and gives an example:

django-admin.py makemessages -l de

Make sure you read that whole section to get an idea of how to generate/edit these files. Also, if you're looking for a great tool to help you manage your translations (and even use Google translations to use as a starting place), check out django-rosetta.

bchang
yep. thanks I've re-read the whole thing. There is no mention of placeholders in .po files.thanks for the tip about the rosetta tool.
Evgeny
When you run the makemessages command, it creates a po file for the specified language, which you can edit manually or using something like rosetta. What is still not clear?
bchang
+1  A: 

Use: python manage.py makemessages -l <target_language> (or makemessages -a for all languages)

That'll automatically create all the msgid's in the po's, all that's left for you is to fill out the msgstr's.

.po is the standard format used by the gettext library, which is available in virtually every modern programming language.

oggy