Tuesday, November 23, 2010

makemessages failing to extract all strings from Javascript

I'm having some trouble with makemessages failing while parsing my
javascript files. I'm running it with domain set to djangojs and it's
successfully finding all my javascript files but keeps halting during
the parsing.

I did a bit of debugging in the makemessages command (Django version
1.2.1 and trunk) and found that when running in djangojs mode it
pythonizes the javascript files with pythonize_re.sub('\n#', src), but
then runs the xgettext shell command with language "Perl". Why is
this?

The javascript code it's bailing out on is stuff like this:

message.css("margin-left", -1*message.width()/2);
$(".action", form).val(id ? "change" : "create");

The outcome is a bit random, for some javascript functions the parser
just skips the function, which also skips the gettext calls in it, and
at other times it just breaks out of the whole file with no further
processing. So I'm not entirely sure what the makemessages command is
supposed to be doing ("converting" the javascript to python and
running xgettext on it as if it were perl?).

Any clarification on this would be great, thanks!

-Lau

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate