Why translations.js does not contain any string from .pot file during nggettext_compile?

408 views Asked by At
grunt.loadNpmTasks('grunt-angular-gettext');
grunt.initConfig({
nggettext_extract:{
  pot:{
    files:{
      'po/template.pot':['**/*.html']
    }
  }
},
nggettext_compile: {
  all:{
    files:{
      'translations.js':['po/*.po']
    }
  }
}
});

controller

app.run(['gettextCatalog',function(gettextCatalog){
  gettextCatalog.currentLanguage='de';
  gettextCatalog.debug='true';
}])

html

<div class="row margin-bottom">
    <div ng-controller="DefCtrl">
      <p translate> Welcome!!!!</p>
      <p translate> Testing globalization and localization</p>
    </div>
  </div>

I am running these commands:

grunt nggettext_extract
grunt nggettext_compile

Both run successfully but translations.js does not contain any string from .pot file

2

There are 2 answers

0
Prozak On

In case anyone is still looking for the documentation you have to use waybackwhen. https://web.archive.org/ and then paste the link.

1
Ruben Vermeersch On

The .pot file is a template for translations and shouldn't contain the actual translations. A full guide for translating correctly can be found on the angular-gettext website: https://angular-gettext.rocketeer.be/dev-guide/translate/