#5493: make-messages.py not parses JS *.html templates for domain djangojs
-------------------------------------+-------------------------------------
     Reporter:  msaelices            |                    Owner:  nobody
         Type:  New feature          |                   Status:  reopened
    Component:                       |                  Version:  1.4
  Internationalization               |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:  javascript tools     |  Unreviewed
  feature_request                    |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by tonnzor):

 * has_patch:  1 => 0
 * type:  Bug => New feature


Comment:

 It was a good start, but we need something more sophisticated as
 `xgettext` breaks in some cases on EJS files..

 We need a way to provide a way to use custom pre-processors for
 `makemessages` for each of extensions.

 In this case I would be able to simply attach needed parser to my file
 extension (e.g. `.ejs`) and do any needed logic there.

 Something like this:
 {{{#!python
 # in settings.py
 GETTEXT_PROCESSORS = {
 '.ejs': 'mysite.gettext_processors.ejs'
 }

 # in django/core/management/commands/makemessages.py
 processor = django.conf.settings.GETTEXT_PROCESSORS.get(file_ext,
 default_processor)
 src_data = processor(src_data)
 }}}

 It seems to be quite straightforward change that would break nothing but
 add a way to customize it.

 Any better ideas how to allow using custom processors are welcome.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/5493#comment:8>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to