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

コントローラ

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>

これらのコマンドを実行しています:

grunt nggettext_extract
grunt nggettext_compile

どちらも正常に実行されますが、translations.js には .pot ファイルの文字列が含まれていません

4

2 に答える 2