Thursday, September 2, 2010

Re: Where and how should I write translations

I tried to create second .po file with manual translations, but had no
luck either :( `compilemessages` creates the second .mo file, but doesn't
use it in the app. Only django.mo is used, but all my translations in
django.po file are commented out after I run `makemessages`.

In the documentation:

"(The caveat with using variables or computed values, as in the previous
two examples, is that Django's translation-string-detecting utility,
django-admin.py makemessages, won't be able to find these strings. More on
makemessages later.)"

But there is no "later" :(

Thanks,
Martin

On Thu, 02 Sep 2010 13:33:36 +0200, Martin Tiršel <django@blackpage.eu>
wrote:

> Hello,
>
> I can not find in Django documentation a word about translating
> variables or strings with variables. I have:
>
> ...
> <legend>{% trans question_category %}</legend>
> ...
>
> django-admin.py makemessages creates .po but without a mention about
> this template line ({% trans "some text" %} is ok). It is clear, that I
> have somehow to specify translation strings in .po file, but when I do
> it manually, next django-admin.py makemessages overwrite the .po file.
>
> So, my question is, where and how should I write translation for strings
> in variables (or variable in a string)?
>
>
> Next, I have some strings in initial_data.json fixture, is there a way
> how to automatically extract it into .po file while running
> django-admin.py makemessages? Or it could extract it from database, it
> doesn't matter. Yes, I know, that I should change DB structure and not
> translate strings from DB this way, but I have my reasons why I am
> doing it so.
>
> Thanks,
> Martin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment