Opened 9 years ago

Last modified 8 years ago

#25223 closed New feature

Setting LANGUAGE_CODE to a language that doesn't exist in django/conf/locale raises IOError — at Version 1

Reported by: Sander van Leeuwen Owned by: nobody
Component: Internationalization Version: 1.8
Severity: Normal Keywords:
Cc: desecho@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Sander van Leeuwen)

Getting a DjangoTranslation that doesn't exist used to return None.

Since this commit it raises an IOError when using a language that's not available in django.

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'

Change History (1)

comment:1 by Sander van Leeuwen, 9 years ago

Description: modified (diff)
Summary: Getting DjangoTranslation that doesn't exist should return NoneSetting LANGUAGE_CODE to a language that doesn't exist in django/conf/locale raises IOError
Note: See TracTickets for help on using tickets.
Back to Top