Skip to content

Instantly share code, notes, and snippets.

@ypetya
Created July 17, 2014 13:09
Show Gist options
  • Select an option

  • Save ypetya/c144012336badf0bcb56 to your computer and use it in GitHub Desktop.

Select an option

Save ypetya/c144012336badf0bcb56 to your computer and use it in GitHub Desktop.
Gruntfile.js for angular-gettext example
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 html files in the current directory or any sub directory of it and output the result of the task into a file called template.pot
}
}
},
nggettext_compile:{
all:{
files:{
'translations.js':['po/*.po'] //we want this task to load all po files in the subfolder po of the current directory and compile them into a resulting file translations.js located in the current directory.
}
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment