Opened 7 years ago

Closed 7 years ago

#9710 closed (worksforme)

Models translations in applications does not work

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


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 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 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 Changed 7 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

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 and that the language you are translating your app to is one of the languages Django has been translated to as explained at (or use the workaround described there there).

Closing as worksforme.

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