[Django] #19567: Make javascript i18n view as CBV and more extensible.

26 views
Skip to first unread message

Django

unread,
Jan 5, 2013, 5:01:05 AM1/5/13
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
-------------------------------+-----------------------------
Reporter: niwi | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords: i18n javascript
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------
The current view populates a global namespace (see
https://code.djangoproject.com/ticket/18231) but also is very monolitic.

My proposal is create a CBV. I don't understand the use of templates for
rendering a view (related ticket).
Now, the initial code is available on this file: https://github.com/niwibe
/django-jsgettext/blob/master/djsgettext/views.py

If the proposal is accepted, I will create a patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/19567>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 5, 2013, 8:28:30 AM1/5/13
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
---------------------------------+--------------------------------------
Reporter: niwi | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: needsinfo

Keywords: i18n javascript | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by russellm):

* status: new => closed
* needs_better_patch: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_docs: => 0


Comment:

I'm not sure I see what you're proposing here, or why you're proposing it.

#18231 describes a problem with the javascript catalog; that is an
accepted bug that needs to be solved.

I'm not sure I see what moving to a CBV approach gains us. You say the
current implementation is 'monolithic' - what problem are you trying to
solve that the current implementation prevents?

Before you get to committed to implementing a solution, we need to be
clear on what problem you're solving. "It's not a CBV" isn't a problem
unless a class-based approach will give flexibility that is actually
required, and based on your sample implementation, I'm not sure I see what
flexibility we will gain by making the view class-based.

Feel free to reopen with more details on the advantages of going down a
class-based approach to the i18n catalog.

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:1>

Django

unread,
Jan 5, 2013, 9:02:32 AM1/5/13
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
---------------------------------+--------------------------------------

Reporter: niwi | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: i18n javascript | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by niwi):

* status: closed => new
* resolution: needsinfo =>


Comment:

I think the advantages are obvious but I'll try to explain:

- Allow users to change certain behaviors without completely rewriting the
view
- Allow expose more than one gettext domain (and not force to use only a
"djangojs" domain)

It is very useful to expose different domain that "djangojs". A real case:
javascript templates.

The current makemessages command not parse well html files with javascript
templates (with domain "djangojs"). A clean solution is to create another
command which parses only js templates and place it contents in another po
file distinct of "djangojs.po".

The current view is monolithic and if you want to change any behavior, the
solution is full rewrite. I think what the framework must give some
facility for doing this.

https://github.com/niwibe/django-jsgettext this plugin allows collect
messages from htmls what contains javascript templates in other domain
distinct from djangojs and currentlly no way to expose these messages to
the js.

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:2>

Django

unread,
Jan 26, 2013, 1:09:51 PM1/26/13
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
--------------------------------------+------------------------------------
Reporter: niwi | Owner: nobody
Type: New feature | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* type: Uncategorized => New feature
* component: Uncategorized => Internationalization
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:3>

Django

unread,
May 31, 2013, 2:48:26 PM5/31/13
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
--------------------------------------+------------------------------------
Reporter: niwi | Owner: nobody

Type: New feature | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timo):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/678

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:4>

Django

unread,
Aug 8, 2013, 6:24:25 AM8/8/13
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
--------------------------------------+------------------------------------
Reporter: niwi | Owner: nobody

Type: New feature | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by KJ):

* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* needs_docs: 0 => 1


Comment:

I’ve made a comment in the pull request.

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:5>

Django

unread,
Apr 11, 2014, 2:16:14 PM4/11/14
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
-------------------------------------+-------------------------------------
Reporter: niwi | Owner: alejandro
Type: New feature | Status: assigned
Component: | Version: master
Internationalization | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: i18n javascript | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 1
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by alejandro):

* status: new => assigned
* owner: nobody => alejandro


--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:6>

Django

unread,
Mar 8, 2016, 5:00:53 PM3/8/16
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
--------------------------------------+------------------------------------
Reporter: niwi | Owner: claudep

Type: New feature | Status: assigned
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* owner: alejandro => claudep
* needs_tests: 1 => 0


Comment:

I have a [https://github.com/django/django/pull/6257 revised patch] with
work in progress.

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:7>

Django

unread,
Mar 26, 2016, 8:26:20 AM3/26/16
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
--------------------------------------+------------------------------------
Reporter: niwi | Owner: claudep
Type: New feature | Status: assigned
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0


Comment:

[https://github.com/django/django/pull/6257 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:8>

Django

unread,
Mar 28, 2016, 7:21:25 PM3/28/16
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
--------------------------------------+------------------------------------
Reporter: niwi | Owner: claudep
Type: New feature | Status: assigned
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1


Comment:

Left some review comments.

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:9>

Django

unread,
Apr 10, 2016, 5:55:50 AM4/10/16
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
--------------------------------------+------------------------------------
Reporter: niwi | Owner: claudep
Type: New feature | Status: assigned
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:10>

Django

unread,
Apr 12, 2016, 1:17:38 PM4/12/16
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
-------------------------------------+-------------------------------------

Reporter: niwi | Owner: claudep
Type: New feature | Status: assigned
Component: | Version: master
Internationalization |
Severity: Normal | Resolution:
Keywords: i18n javascript | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:11>

Django

unread,
Apr 15, 2016, 11:30:16 AM4/15/16
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
-------------------------------------+-------------------------------------
Reporter: niwi | Owner: claudep
Type: New feature | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: fixed

Keywords: i18n javascript | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"de40cfbe74642df1e94c131e1adaa3363173c0cf" de40cfbe]:
{{{
#!CommitTicketReference repository=""
revision="de40cfbe74642df1e94c131e1adaa3363173c0cf"
Fixed #19567 -- Added JavaScriptCatalog and JSONCatalog class-based views

Thanks Cristiano Coelho and Tim Graham for the reviews.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:12>

Django

unread,
Jan 17, 2017, 10:09:52 PM1/17/17
to django-...@googlegroups.com
#19567: Make javascript i18n view as CBV and more extensible.
-------------------------------------+-------------------------------------
Reporter: Andrei Antoukh | Owner: Claude
| Paroz

Type: New feature | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: i18n javascript | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"2b20e4148f4f54431834e6a43af6c39dc75e6362" 2b20e41]:
{{{
#!CommitTicketReference repository=""
revision="2b20e4148f4f54431834e6a43af6c39dc75e6362"
Refs #19567 -- Removed deprecated javascript_catalog() and json_catalog()
views.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19567#comment:13>

Reply all
Reply to author
Forward
0 new messages