Reputation: 505
I've got a bunch of strings marked for translation in my python code.
For example:
remarks_sample = forms.CharField(
label = _('Remarks'),
widget = forms.Textarea(attrs = {
'placeholder': _("Remarks"),
})
)
I've successfully ran django-admin.py makemessages and translated the phrases in Rosetta admin. I'm trying to figure out why the translated phrases arn't showing up on my pages.
Upvotes: 3
Views: 1919
Reputation: 1226
Were the files actually written to by django-rosetta? If Rosetta can't write the content back to the .po files (e.g. because they are not writable by the web server process) it'll just keep them in memory (you can download your translations, and replace the files.)
Also, you can run django-admin.py compilemessages
to explicitly compile the updated .po files into .mo files, which are read by Django, before restarting the webserver.
Also, is _
aliased to ugettext
or ugettext_lazy
? It should probably be the latter.
Upvotes: 5
Reputation: 6323
If you are using development server you would have to restart it as it would not detect updated translations itself.
If you are on production server, you probably want to tell rosetta to auto reload (see: Rosetta Configuration).
Upvotes: 0