4

I'm building a website with Django 1.6 and Python 2.7, and translating it into a second language. The Django framework messages, and strings in my own templates and code are all translating fine.

I'm using the django-passwords module, which doesn't have built-in translation. (The Python code in django-passwords looks to be correctly marked for translation with ugettext_lazy, but the module contains no ready-rolled translations.)

I've created a messages file at the django-passwords level (as suggested in Django's I18N with third-party apps), added some translated strings and compiled it. However, the strings from django-passwords are still displayed in English when I run my app.

django-passwords is installed at c:/Python27/lib/site-packages/passwords and the compiled messages file is at c:/Python27/lib/site-packages/passwords/locale/fr/LC_MESSAGES/django.mo

(I have also tried the symlinking approach suggested in the above answer, but the strings from django-passwords do not get pulled in to my app-level .po file. I'm on Windows, so would sooner avoid symlinks if possible.)

What other steps do I need to do to get my app to use translated strings when displaying messages about password validation?

Community
  • 1
  • 1
user3468054
  • 610
  • 4
  • 11

1 Answers1

0

After banging my head around for a all afternoon this is how i worked for me:

1 - add the translations i wanted to my `django-password` forked repository
2 - pip install git+https://github.com/Ubiwhere/django-passwords.git@3a0f70d11561cff690eb2a01c613a4280a8d641f
3 - add `passwords` to `INSTALLED_APPS` in settings.py (adding `django-passwords`does not work)

After this the new translations started working.

psychok7
  • 5,373
  • 9
  • 63
  • 101