我想使用 angular-gettext 在我的应用程序上实现 i18n,我按照这个http://lostechies.com/gabrielschenker/2014/02/11/angularjspart-12-multi-language-support/ 我使用了这个命令:
npm install -g grunt-cli
npm install grunt
npm install grunt-angular-gettext
Run Code Online (Sandbox Code Playgroud)
我的 Gruntfile.js :
module.exports=function(grunt){
grunt.loadNpmTasks('grunt-angular-gettext');
//This task will parse all our source files and extract the texts we want to have translated – the ones that have an associated translate directive – and add them to a so called pot file.
grunt.initConfig({
nggettext_extract:{ //we define the task name we want to configure or initialize
pot:{
files:{
'po/template.pot':['../templates/*.html'] //we want the task to parse all …Run Code Online (Sandbox Code Playgroud)