have your own local .po files - do not tell me that you are your local
stuff in django's .po files?
--
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/
yes - that is what the docs say
>
> like:
> projectpath/locale/LANG/LC_MASSAGES/email.po
> projectpath/locale/LANG/LC_MASSAGES/messages.po ??
better: apppath/locale/LANG/LC_MESSAGES/django.po
LC_MASSAGES is wrong, it is LC_MESSAGES
and then call manage.py makemessages -s -l <lang>
You shouldn't be manually creating these files at all, django provides
tools that do that for you (and spell LC_MESSAGES correctly etc). You
simply run django-admin.py makemessages -l <lang> from the top level
of each app that is to be translated, and it correctly populates
./locale/<lang>/LC_MESSAGES/django.po with the translations that have
been marked up in that apps templates and source code.
I'd suggest a thorough re-read of the documentation if you ever find
yourself manually creating pofiles.
Cheers
Tom
locale/<lang>/LC_MESSAGES/model.po
locale/<lang>/LC_MESSAGES/forms.po
manage.py compilemessages will compile them successfully to create .mo
files BUT django (1.3) will not load them. It expects to see ONE file
called django.mo - it will not load the other mo files and if there is
no django.mo file then no translations are loaded.
A possible step would be to split the files then simply concatenate them
together, using a custom management command, before calling
compilemessages. That would make it easier to manage the translations
but at the cost of an extra step in preparing for deployment.
Stuart MacKay
Lisbon, Portugal
It would though, in my opinion, be a good feature to maybe specify
which files to compile with compilemessages such that this feature was
built into django.
E.g.
$ ls
forms.po models.po translators.po
$ django-admin.py compilemessages translators.po models.po
$ ls
forms.po models.po translators.po django.mo
Or something. I'm not a django developer, but I'm sure someone here
is, and this may have been a ticket sometime? :)
--
With regards, Herman Schistad
Thanks for rectifying my answer.
On 6/24/2011 5:01 PM, Tom Evans wrote:
> On Fri, Jun 24, 2011 at 3:45 PM, Gelonida<gelo...@gmail.com> wrote:
>> Perhaps I'm wrong, but I thought it's enough to just create a
>> locale/<lang>/LC_MESSAGES/django.po file
>> in your project tree
>>
>> and then call manage.py makemessages -s -l<lang>
>>
>
> You shouldn't be manually creating these files at all, django provides
> tools that do that for you (and spell LC_MESSAGES correctly etc). You
> simply run django-admin.py makemessages -l<lang> from the top level
> of each app that is to be translated, and it correctly populates
> ./locale/<lang>/LC_MESSAGES/django.po with the translations that have
> been marked up in that apps templates and source code.
Fully agree. Just started working with Django. I used makemessages as
the doc (and you) suggested.
I just forgot about it when writing this post.