It states that Babel can retrieve gettext messages for Python and Javascript files.
Babel has several built-in extractors: python (which extracts messages from Python source files), javascript and ignore (doesn't extract anything).
The output from the command line is documented here - but without usage examples.
Also in the same index above, there is a mention of the configuration file that will be used with the extraction, but not much expanded.
When I run the main command for the extractor in the directory with js files, I get only the .PO header and not the message.
$ pybabel extract /path/to/js-dir
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2012-04-22 19:39+1000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
$
Here is an example segment from a js file that I am trying to extract from messages:
else if(data.status == "1"){
var follow_html = gettext('Follow');
object.attr("class", 'button follow');
object.html(follow_html);
var fav = getFavoriteNumber();
fav.removeClass("my-favorite-number");
if(data.count === 0){
data.count = '';
fav.text('');
}else{
var fmts = ngettext('%s follower', '%s followers', data.count);
fav.text(interpolate(fmts, [data.count]));
}
}
, - CLI , , .