Opened 17 years ago

Closed 17 years ago

#7180 closed (duplicate)

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

Reported by: anonymous Owned by: nobody
Component: Internationalization Version: dev
Severity: Keywords: make-messages.py i18n
Cc: patrick.lauber@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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.

Change History (3)

comment:1 by tumma72@…, 17 years ago

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 :-)

comment:2 by Patrick Lauber <patrick.lauber@…>, 17 years ago

Cc: patrick.lauber@… added

It would be nice if it parses all files in the templates directory and you don't have to specify it.

comment:3 by Jacob, 17 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #5463 (which has a fix).

Note: See TracTickets for help on using tickets.
Back to Top