[Django] #31914: Django does not pick up .mo files when LOCALE_PATHS is unset

7 views
Skip to first unread message

Django

unread,
Aug 20, 2020, 5:15:07 AM8/20/20
to django-...@googlegroups.com
#31914: Django does not pick up .mo files when LOCALE_PATHS is unset
------------------------------------------------+------------------------
Reporter: Ondřej Kolín | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 3.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
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.

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

Django

unread,
Aug 20, 2020, 5:31:04 AM8/20/20
to django-...@googlegroups.com
#31914: Django does not pick up .mo files when LOCALE_PATHS is unset
-------------------------------------+-------------------------------------

Reporter: Ondřej Kolín | Owner: nobody
Type: Bug | Status: new
Component: | Version: 3.1
Internationalization |
Severity: Normal | Resolution:

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):

* Attachment "without_locales_path_set.png" added.

Without locales path set

Django

unread,
Aug 20, 2020, 5:31:16 AM8/20/20
to django-...@googlegroups.com
#31914: Django does not pick up .mo files when LOCALE_PATHS is unset
-------------------------------------+-------------------------------------

Reporter: Ondřej Kolín | Owner: nobody
Type: Bug | Status: new
Component: | Version: 3.1
Internationalization |
Severity: Normal | Resolution:
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):

* Attachment "with_locales_path_set.png" added.

Django

unread,
Aug 20, 2020, 5:33:53 AM8/20/20
to django-...@googlegroups.com
#31914: Django does not pick up .mo files when LOCALE_PATHS is unset
-------------------------------------+-------------------------------------

Reporter: Ondřej Kolín | Owner: nobody
Type: Bug | Status: new
Component: | Version: 3.1
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Ondřej Kolín:

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.

New 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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31914#comment:1>

Django

unread,
Aug 20, 2020, 5:39:53 AM8/20/20
to django-...@googlegroups.com
#31914: Django does not pick up .mo files when LOCALE_PATHS is unset
-------------------------------------+-------------------------------------

Reporter: Ondřej Kolín | Owner: nobody
Type: Bug | Status: new
Component: | Version: 3.1
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Ondřej Kolín:

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

New 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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31914#comment:2>

Django

unread,
Aug 20, 2020, 7:25:30 AM8/20/20
to django-...@googlegroups.com
#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

unread,
Aug 20, 2020, 7:37:34 AM8/20/20
to django-...@googlegroups.com
#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: invalid

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 felixxm):

* resolution: fixed => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/31914#comment:4>

Reply all
Reply to author
Forward
0 new messages