- `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.
* 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>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/30241#comment:2>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/30241#comment:3>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/30241#comment:4>
* 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>
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>
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>