ken
ken

Reputation: 11

Is there a good way to manage very long translation texts in Django?

For Django i18n, it is common to use makemassages and compilemessages to create django.po and django.mo files. It works very well for translating short text fragments, and in fact I've been able to i18n almost all of my website using it. Usually, however, a website is not just fragmented text, but has several pages containing very very long sentences, such as "Terms of Use," "User Guide," and so on.

If we try to translate them using Django's features (trans, blocktrans), the po file become hard to manage. It seems silly to me to manage these fragmented texts and very long sentences in one po file.

So I have a question.

Is there any way to split up the po files? It would be a solution if I could create a po file specifically for pages containing such long sentences, but I couldn't find such an option in the Django manual.

Or is there another better way? I'd like to avoid having separate template files for each language and using {% if %} on the templates to display them. (but unfortunately, that's actually how I'm dealing with it now)

I checked the Django manual; I also checked the gettext manual. But I couldn't find a good way.

Upvotes: 1

Views: 28

Answers (0)

Related Questions