makemessages for js templates

12 views
Skip to first unread message

Nacharov Mikhail

unread,
Jan 19, 2017, 7:17:03 AM1/19/17
to Django users
Hello,

does somebody know how can I use makemessages commad to collect translation strings from js templates?

For example, in mustache(handlebars) templates I would like to have something like this:

{{#baggage}}
<td>
    {{#gettext}}{{ num }} bag{{/gettext}}
</td>
{{/baggage}}


Where gettext is the javascript function, which used django's js function for translation through javascript-catalog:

{
//... Passed to Mustache context:
  "gettext": function () {
    return function (text, render) {
      return gettext(text);
    }
  }
//..
}


I thought that it would be easy to collect text from those templates with domain set to djangojs. But I can't find a way to do that..
Reply all
Reply to author
Forward
0 new messages