Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gulp.task 'i18n', ->
- fs = require 'fs'
- locales_dir = 'src/locales'
- locales = fs.readdirSync locales_dir
- for locale in locales
- locale_dir = locales_dir+'/'+locale
- stat = fs.statSync locale_dir
- if !stat.isDirectory()
- continue
- locale_file = locale_dir+'/translation.json'
- translation = JSON.parse(fs.readFileSync(locale_file, 'utf-8'))
- console.log translation.header.nav.b1
- gulp.src 'src/jade/*.jade'
- .pipe consolidate 'jade', translation
- .pipe extReplace '.html'
- .pipe prettify
- indent_char: ' '
- indent_size: 2
- .pipe gulp.dest 'build/'+locale
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement