Created
July 17, 2014 13:09
-
-
Save ypetya/c144012336badf0bcb56 to your computer and use it in GitHub Desktop.
Gruntfile.js for angular-gettext example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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