Opened 11 years ago
Closed 9 years ago
#22404 closed New feature (fixed)
Make front-end getext catalog available as JSON
Reported by: | Owned by: | Sergey Kolosov | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This is a question related to #22403.
It seems like it would be nice if the front-end gettext catalogs were simply available as JSON (and not as a custom js function, injected into the global namespace). This would allow the community to use (or build) separate client libraries for handing these translation strings.
Does that seem like a feature that others would be interested in?
Change History (10)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Hi, I've been working with Django for the last few months and I will like to contribute with this feature.
What I propose is a javascript view json_catalog that returns the language settings as a json object like this:
{catalog:{ 'translate this':'traduce esto', 'one plural sample': [ 'un ejemplo de plural', 'muchos ejemplos de plural' ] }, plural: null, formats: { "DATETIME_FORMAT": "N j, Y, P", "DATE_FORMAT": "N j, Y", "DECIMAL_SEPARATOR": ".", ... }}
Here is the code:
https://github.com/manologab/django/tree/ticket_22404
Please let me know if you agree with this approach before going any further.
comment:3 by , 10 years ago
Component: | Translations → Internationalization |
---|---|
Version: | 1.6 → master |
comment:4 by , 9 years ago
Owner: | changed from | to
---|
Working on that during DjangoCon Europe 2015 sprints.
comment:6 by , 9 years ago
Has patch: | set |
---|
comment:8 by , 9 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
Reviewed the PR a bit more.
comment:9 by , 9 years ago
Patch needs improvement: | unset |
---|
PR updated https://github.com/django/django/pull/4808
Yes, that should be possible somehow.