Opened 9 years ago
Closed 8 years ago
#25223 closed New feature (duplicate)
Allow default language to be one unsupported by django if the local project has the required translation catalog
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 )
Update:
Changed from bug to feature request.
See beck's comments below.
---
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 (6)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | Getting DjangoTranslation that doesn't exist should return None → Setting LANGUAGE_CODE to a language that doesn't exist in django/conf/locale raises IOError |
comment:3 by , 9 years ago
Note: the fix for #21055 added support for activating a language not in django/conf/locale
comment:4 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | Setting LANGUAGE_CODE to a language that doesn't exist in django/conf/locale raises IOError → Allow default language to be one unsupported by django if the local project has the required translation catalog |
Type: | Bug → New feature |
comment:5 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:6 by , 8 years ago
Cc: | added |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
This is a duplicate of #25915.
Indeed. This is by design.
The reason is to catch broken django installs. If trying to activate a supported language and the django translations are missing/unreadable (referencing #18192), the framework needs to blowup and make the user aware of the issue.
When trying to set the default language to one not supported by django, this action has the same side-effects as activating a common language with a broken install.
IMO catching a broken install is more critical and a more common use-case than setting the default language to one (not yet) supported.
However, django will let you use and activate a custom language (just not make it the default).
To exemplify:
projectdir/locale/sd/LC_MESSAGES/django.po
:test.py
: Runtest.py
through django shell:As for this ticket, since all is working by design I do not believe it to be a bug.
This ticket could be reworded as a feature request:
Or open a new pull on django adding Sindhi :)