Django

Code

Ticket #7180 (new)

Opened 2 weeks ago

Last modified 2 weeks ago

make-messages.py using I18N_TEMPLATES_EXTENSIONS from settings...

Reported by: anonymous Assigned to: nobody
Component: Internationalization Version: SVN
Keywords: make-messages.py i18n Cc:
Triage Stage: Unreviewed Has patch: 0
Needs documentation: 0 Needs tests: 0
Patch needs improvement: 0

Description

It would be nice if the make-messages.py script would use the I18N_TEMPLATES_EXTENSIONS from the settings file and not only parse .html files. In case one defines multiple templates extensions like:

I18N_TEMPLATES_EXTENSIONS = ('.html', '.tpl')

The make-messages.py will not consider the .tpl file. The annoying part is that even when the keys (msgid, msgstr) are manually added, every time the script runs, it comments out the not recognized or detected pairs.

Attachments

Change History

05/06/08 13:29:55 changed by tumma72@gmail.com

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

Sorry i forgot to put the email...

an easy patch would be to read from settings.I18N_TEMPLATES_EXTENSIONS and at line 103:

     os.unlink(os.path.join(dirpath, thefile))
            elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')):
                thefile = file
                if file.endswith('.html'):

and change it with:

            file_ext = file.split('.').pop()
            elif domain == 'django' and (file.endswith('.py') or file_ext in settings.I18N_TEMPLATES_EXTENSIONS):
                thefile = file
                if file_ext in settings.I18N_TEMPLATES_EXTENSIONS:

I didn't really try it out, is just a quick idea that cames out while writing... sorry, I think there are surely more elegant way to solve the problem :-)

Compliments for the Great Framework :-)


Add/Change #7180 (make-messages.py using I18N_TEMPLATES_EXTENSIONS from settings...)




Change Properties
Action