Opened 16 years ago

Closed 16 years ago

#9710 closed (worksforme)

Models translations in applications does not work

Reported by: me_22 Owned by: nobody
Component: Internationalization Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There is a project and an application with a model like this:

from django.utils.translation import gettext_lazy as _
class MODEL(models.Model):
    name = models.TextField(_("NAME"))

When creating the *.po file running manage.py makemessages in the application directory and translating and compiling messages, it does not work in the admin panel. It behaves like there isn't any translation.

All works when I create translations in the project directory, then everything is OK without any changes in the settings.py file or anything else.

I can't have translations for the whole project as I need to have some applications in many projects so I want to translate the models once.

Change History (1)

comment:1 by Ramiro Morales, 16 years ago

Resolution: worksforme
Status: newclosed

I can't reproduce this.

Make sure your .po and .mo files are located in locale/xx_YY/LC_MESSSAGES/ under your application directory as explained at http://docs.djangoproject.com/en/dev/topics/i18n/#using-translations-in-your-own-projects and that the language you are translating your app to is one of the languages Django has been translated to as explained at http://docs.djangoproject.com/en/dev/topics/i18n/#id1 (or use the workaround described there there).

Closing as worksforme.

Note: See TracTickets for help on using tickets.
Back to Top