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

控制器爲什麼在nggettext_compile期間,translations.js不包含.pot文件中的任何字符串?

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文件包含的任何字符串

回答

相關問題