title: Django makemessages javascript (xgettext)
body: <p>I want to use django i18n support to translate my javascript files. 
  I have the following javascript file:</p>
  
  <pre><code>var test_text = gettext('example');
  
  @withStyles(styles)
  export default class HomePage {
    static contextTypes = {
      i18n: PropTypes.object
    }
  
    constructor() {
      this.componentDidMount.bind(this);
      this.handleCitySearch.bind(this);
    }
  
    render() {
      return (
        &lt;Grid className="HomePage"&gt;
          &lt;Row className="HomePage-hero"&gt;
            &lt;Col md={8} style={{ textAlign: 'center' }}&gt;
              &lt;Input ref="city" bsSize="large" type="text" /&gt;
              &lt;Button bsSize="large" bsStyle="default" onClick={this.handleCitySearch}&gt;{gettext('button text')}&lt;/Button&gt;
            &lt;/Col&gt;
            &lt;Col md={4}&gt;
              &lt;ul&gt;
                &lt;li&gt;{gettext('SOME TEXT')}&lt;/li&gt;
                &lt;li&gt;{gettext('MORE TEXT')}&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/Col&gt;
          &lt;/Row&gt;
        &lt;/Grid&gt;
        );
    }
  }
  </code></pre>
  
  <p>Now I run djangos makemessages command:</p>
  
  <pre><code>python manage.py makemessages -l de -d djangojs -v 3 -s
  </code></pre>
  
  <p>I would expect that the created translation file has four entries ('example', 'button text', 'SOME TEXT', and 'MORE TEXT'), because <code>gettext</code> appears three times in the js file. 
  But the created locale file has only two entry for "example":</p>
  
  <pre><code>#: ../HomePage.js:1
  msgid "example"
  msgstr ""
  
  #: ../HomePage.js:25
  msgid "MORE TEXT"
  msgstr ""
  </code></pre>
  
  <p>I also get this warning. But have no clue what it means (the file has only 32 lines)</p>
  
  <pre><code>HomePage.js:33: warning: RegExp literal terminated too early
  </code></pre>
  
  <p>Does anyone know why django ignores the other entries?
  Maybe it's because I use the jsx syntax or because I use es6 classes?</p>
  
  <h2>UPDATE:</h2>
  
  <p>I found out that this is not a problem of django but of <code>xgettext</code>.
  Django calls <code>xgettext</code> with the following command:</p>
  
  <pre><code>xgettext  --language=JavaScript --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=pgettext:1c,2 --keyword=npgettext:1c,2,3 --output=- --from-code=UTF-8 --add-comments=Translators  ../HomePage.js
  </code></pre>
  
  <p>So is there any <code>xgettext</code> expert who can help me?</p>