#31914: Django does not pick up .mo files when LOCALE_PATHS is unset
-------------------------------------+-------------------------------------
     Reporter:  Ondřej Kolín         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:                       |                  Version:  3.1
  Internationalization               |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Ondřej Kolín):

 * status:  new => closed
 * resolution:   => fixed


Old description:

> 1. Set LANGUAGE_CODE and LANGUAGES in settings.py
> 2. You are able to makemessages and compilemessages
> 3. Django is not picking up the translated messages
> 4. Set the LOCALE_PATHS variable in the settings.py
> 5. django now picks the messages
>
> Fragment of settings.py
> {{{
> LANGUAGE_CODE = 'en'
> LANGUAGES =[ ('en', _('English')), ('cs', _('Czech')) ]
> LOCALE_PATHS = (
>     os.path.join(BASE_DIR, 'locale'),
> )
> }}}
>
> If this is intended, I think that makemessages/compile messages should
> fail as well. If not, the discovery should work as well.
>
> Basic dir structure
> .
> ├── db.sqlite3
> ├── locale
> ├── manage.py
> ├── safecloud
> ├── secshare
> └── static
>
> cat ./../venv/pyvenv.cfg
> home = /usr/bin
> include-system-site-packages = false
> version = 3.8.3

New description:

 Update: Kinda resolved, see my comment.

 1. Set LANGUAGE_CODE and LANGUAGES in settings.py
 2. You are able to makemessages and compilemessages
 3. Django is not picking up the translated messages
 4. Set the LOCALE_PATHS variable in the settings.py
 5. django now picks the messages

 Fragment of settings.py
 {{{
 LANGUAGE_CODE = 'en'
 LANGUAGES =[ ('en', _('English')), ('cs', _('Czech')) ]
 LOCALE_PATHS = (
     os.path.join(BASE_DIR, 'locale'),
 )
 }}}

 If this is intended, I think that makemessages/compile messages should
 fail as well. If not, the discovery should work as well.

 Basic dir structure
 .
 ├── db.sqlite3
 ├── locale
 ├── manage.py
 ├── safecloud
 ├── secshare
 └── static

 cat ./../venv/pyvenv.cfg
 home = /usr/bin
 include-system-site-packages = false
 version = 3.8.3

--

Comment:

 As @felix pointed on irc.freenode.org #django-dev, the behaviour is
 documented.

 But I still think this is kinda bug, or at least inconsistent, because,
 where is the point to be able to gather messages/compile them, but they
 stay unusable in the system, because the var is not set.

 I think, that ./managepy compilemessages should throw a warning at least.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31914#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.d9dca0d0c3b5dd769dba6bbb86f25001%40djangoproject.com.

Reply via email to