#25223: Setting LANGUAGE_CODE to a language that doesn't exist in
django/conf/locale raises IOError
-------------------------------------+-------------------------------------
Reporter: svleeuwen | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.8
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 svleeuwen):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> Getting a DjangoTranslation that doesn't exist used to return None.
>
> Since
> [https://github.com/django/django/commit/a5f6cbce07b5f3ab48d931e3fd1883c757fb9b45
> #diff-5682903b7aed1649cdb7095331e90d0d this commit] it raises an IOError
> when using an unavailable language.
>
> [https://github.com/django/django/blob/a5f6cbce07b5f3ab48d931e3fd1883c757fb9b45/tests/i18n/tests.py#L1344
> This test] suggests this is wanted behaviour.
>
> But it should be possible to add a language that is not available in
> `django/conf/locale/` right?
>
> To reproduce, use a `LANGUAGE_CODE` unavailable in `django/conf/locale/`.
>
> For instance:
> `LANGUAGE_CODE = 'sd-PK'`
>
> run `python manage.py validate`
>
> This will raise:
> `IOError: [Errno 2] No translation file found for domain: u'django'`
New description:
Getting a DjangoTranslation that doesn't exist used to return None.
Since
[https://github.com/django/django/commit/a5f6cbce07b5f3ab48d931e3fd1883c757fb9b45
#diff-5682903b7aed1649cdb7095331e90d0d this commit] it raises an IOError
when using a language that's not available in django.
[https://github.com/django/django/blob/a5f6cbce07b5f3ab48d931e3fd1883c757fb9b45/tests/i18n/tests.py#L1344
This test] suggests this is wanted behaviour.
But it should be possible to add a language that is not available in
`django/conf/locale/` right?
To reproduce, use a `LANGUAGE_CODE` unavailable in `django/conf/locale/`.
For instance:
`LANGUAGE_CODE = 'sd-PK'`
run `python manage.py validate`
This will raise:
`IOError: [Errno 2] No translation file found for domain: u'django'`
--
--
Ticket URL: <https://code.djangoproject.com/ticket/25223#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.8d5eacd6ee16b30eaf4d6b78c6c661d6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.