[Django] #30241: Add system checks to ensure correct configuration of translation settings.

56 views
Skip to first unread message

Django

unread,
Mar 7, 2019, 5:58:48 PM3/7/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core | Version: master
(System checks) | Keywords: translations,
Severity: Normal | system checks, language tags
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Following on from #29713 which added `translation.E001` to check
`LANGUAGE_CODE`, I proposed the following:;

- `translation.E002`: `'You have provided an invalid language code in the
LANGUAGES setting: {}.'`
- `translation.E003`: `'You have provided an invalid language code in the
LANGUAGES_BIDI setting: {}.'`
- `translation.E004`: `'You have provided a value for the LANGUAGE_CODE
setting that is not in the LANGUAGES setting.'`
- `translation.W005`: `'You have provided values in the LANGUAGE_BIDI
setting that are not in the LANGUAGES setting.'`

Note `W005` instead of `E005` - this case can simply be a warning because
it will not cause things to go wrong, but highlights a potential
configuration issue.

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

Django

unread,
Mar 7, 2019, 6:06:19 PM3/7/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: translations, | Triage Stage:
system checks, language tags | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Old description:

> Following on from #29713 which added `translation.E001` to check
> `LANGUAGE_CODE`, I proposed the following:;
>
> - `translation.E002`: `'You have provided an invalid language code in the
> LANGUAGES setting: {}.'`
> - `translation.E003`: `'You have provided an invalid language code in the
> LANGUAGES_BIDI setting: {}.'`
> - `translation.E004`: `'You have provided a value for the LANGUAGE_CODE
> setting that is not in the LANGUAGES setting.'`
> - `translation.W005`: `'You have provided values in the LANGUAGE_BIDI
> setting that are not in the LANGUAGES setting.'`
>
> Note `W005` instead of `E005` - this case can simply be a warning because
> it will not cause things to go wrong, but highlights a potential
> configuration issue.

New description:

Following on from #29713 which added `translation.E001` to check
`LANGUAGE_CODE`, I proposed the following:;

- `translation.E002`: `'You have provided an invalid language code in the
LANGUAGES setting: {}.'`
- `translation.E003`: `'You have provided an invalid language code in the
LANGUAGES_BIDI setting: {}.'`
- `translation.E004`: `'You have provided a value for the LANGUAGE_CODE
setting that is not in the LANGUAGES setting.'`

- `translation.W005`: `'You have provided values in the LANGUAGES_BIDI


setting that are not in the LANGUAGES setting.'`

Note `W005` instead of `E005` - this case can simply be a warning because
it will not cause things to go wrong, but highlights a potential
configuration issue.

--

Comment:

[https://github.com/django/django/pull/11060 PR]

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

Django

unread,
Mar 7, 2019, 6:58:17 PM3/7/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: translations, | Triage Stage: Accepted
system checks, language tags |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


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

Django

unread,
Mar 11, 2019, 5:47:43 PM3/11/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: translations, | Triage Stage: Accepted
system checks, language tags |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30241#comment:3>

Django

unread,
Mar 27, 2019, 5:42:40 AM3/27/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: translations, | Triage Stage: Ready for
system checks, language tags | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Accepted => Ready for checkin


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

Django

unread,
Mar 28, 2019, 4:57:25 PM3/28/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: closed

Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution: fixed

Keywords: translations, | Triage Stage: Ready for
system checks, language tags | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"4400d8296d268f5a8523cd02ddc33b12219b2535" 4400d82]:
{{{
#!CommitTicketReference repository=""
revision="4400d8296d268f5a8523cd02ddc33b12219b2535"
Fixed #30241 -- Added more system checks of translation settings.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30241#comment:5>

Django

unread,
Apr 8, 2019, 10:44:50 AM4/8/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: closed
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution: fixed
Keywords: translations, | Triage Stage: Ready for
system checks, language tags | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Matthias Kestenholz):

It seems that when overriding `LANGUAGES` it's required to override
`LANGUAGES_BIDI` too. This might not be intentional...?

Example failure: https://travis-
ci.org/matthiask/feincms3-sites/jobs/517232818 respectively

{{{
Destroying test database for alias 'default' ('test_feincms3_sites')...
SystemCheckError: System check identified some issues:
ERRORS:
?: (translation.E005) You have provided values in the LANGUAGES_BIDI


setting that are not in the LANGUAGES setting.

System check identified 1 issue (0 silenced).
The command "cd tests && ./manage.py test -v 2 testapp && cd .." exited
with 1.
}}}

This is with `LANGUAGES = (("en", "English"), ("de", "German"))` and
`LANGUAGES_BIDI` from `django/conf/global_settings.py`

--
Ticket URL: <https://code.djangoproject.com/ticket/30241#comment:6>

Django

unread,
Apr 24, 2019, 9:31:35 AM4/24/19
to django-...@googlegroups.com
#30241: Add system checks to ensure correct configuration of translation settings.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: closed
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution: fixed
Keywords: translations, | Triage Stage: Ready for
system checks, language tags | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"0a01ca80d7f7f1922d0c515669d0e7afd3acff5a" 0a01ca80]:
{{{
#!CommitTicketReference repository=""
revision="0a01ca80d7f7f1922d0c515669d0e7afd3acff5a"
Refs #30241 -- Fixed BytesWarning emitted in test_translation tests.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30241#comment:7>

Reply all
Reply to author
Forward
0 new messages