Opened 9 years ago

Closed 9 years ago

#5347 closed (invalid)

django does not look in the project-dir for a locale directory

Reported by: jumo@… Owned by: nobody
Component: Tools Version: master
Severity: Keywords: i18n, internationalization,,
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:



maybe this is a copy but i couldn't find the "original".

i have a model like this:

from django.db import models
from django.utils.translation import ugettext_lazy as _

# Create your models here.
class Thing(models.Model):
        name = models.CharField(_('in model'),max_length=150)

        class Admin:

and in the root folder of my project (not my application) there is a conf/locale directory

after calling bin/ in the root folder of my project there is a django.po like this:

julian@laptop:~/test/bug$ cat conf/locale/en-us/LC_MESSAGES/django.po 
# This file is distributed under the same license as the PACKAGE package.
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-06 09:42+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: thing/
msgid "in model"
msgstr "in django.po"

after installing that app and calling bin/ the label in the admin-inteface for the name-field is "in model" and not, as i should be, "in django.po". there is no locale/... directory in my application directoy; the documentation reads:

First, it looks for a locale directory in the application directory of the view that’s being called. If it finds a translation for the selected language, the translation will be installed.

there isn't a locale directory in the application directory, so this step should take affect, but it doesn't:

Next, it looks for a locale directory in the project directory. If it finds a translation, the translation will be installed.

where (in the second quote) locale directory should be conf/locale directory, additionally.

Change History (5)

comment:1 Changed 9 years ago by anonymous

Keywords: i18n internationalization added
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 9 years ago by anonymous

Keywords: added; removed

comment:3 Changed 9 years ago by anonymous

Resolution: invalid
Status: newclosed

comment:4 Changed 9 years ago by Simon G. <dev@…>

Resolution: invalid
Status: closedreopened

Please don't do anonymous triage or close tickets without a reason.

comment:5 Changed 9 years ago by Ilya Semenov

Resolution: invalid
Status: reopenedclosed

The documentation ( clearly says that application-level translations should be placed as $APPPATH/locale/<language>/LC_MESSAGES/django.(po|mo). This folder is then auto-discovered.

If you place your translation files at non-default location ($APPPATH/conf/locale/...), you should configure LOCALE_PATHS respectively.

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