Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. gulp.task 'i18n', ->
  2.  
  3. fs = require 'fs'
  4. locales_dir = 'src/locales'
  5. locales = fs.readdirSync locales_dir
  6.  
  7. for locale in locales
  8. locale_dir = locales_dir+'/'+locale
  9. stat = fs.statSync locale_dir
  10. if !stat.isDirectory()
  11. continue
  12. locale_file = locale_dir+'/translation.json'
  13. translation = JSON.parse(fs.readFileSync(locale_file, 'utf-8'))
  14. console.log translation.header.nav.b1
  15.  
  16. gulp.src 'src/jade/*.jade'
  17. .pipe consolidate 'jade', translation
  18. .pipe extReplace '.html'
  19. .pipe prettify
  20. indent_char: ' '
  21. indent_size: 2
  22. .pipe gulp.dest 'build/'+locale
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement