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文件的任何字符串
发布于 2015-10-29 18:39:23
.pot文件是用于翻译的模板,不应该包含实际的翻译。可以在angular-gettext网站上找到正确翻译的完整指南:https://angular-gettext.rocketeer.be/dev-guide/translate/
发布于 2020-06-03 16:37:52
如果有人还在寻找文档,你必须使用waybackwhen。https://web.archive.org/,然后粘贴链接。
https://stackoverflow.com/questions/33231479
复制相似问题