forked from openspending/spendingstories
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.coffee
45 lines (37 loc) · 1.42 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
module.exports = (grunt)->
shell = require('shelljs')
cmd_opts =
silent: true
cmd_result = shell.exec("python scripts/get_supported_languages.py", cmd_opts)
LANGUAGES = JSON.parse cmd_result.output
angular_files = [
'webapp/static/coffee/*.coffee', # our scripts
'webapp/static/coffee/**/*.coffee', # our scripts
'webapp/templates/*.html', # our templates
'webapp/templates/partials/*.html' # our templates
'webapp/templates/partials/**/*.html' # our templates
]
# Project configuration.
grunt.config.init
# i18n & angular translate configuration
i18nextract:
dev:
lang: LANGUAGES
src: angular_files
suffix: ".json"
dest: "webapp/static/locales"
interpolation:
startSymbol: '[['
endSymbol: ']]'
# auto generate i18n json files
watch:
i18n:
files: angular_files
tasks: ['makemessages']
# Load the angular translate task
grunt.loadNpmTasks('grunt-angular-translate')
grunt.loadNpmTasks('grunt-available-tasks')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-shell')
grunt.registerTask 'makemessages', 'i18nextract:dev'
grunt.registerTask 'default', ['available_tasks']