+fs = require 'fs'
 gulp = require 'gulp'
 cache = require 'gulp-cached'
 filelog = require 'gulp-filelog'

  js: ['./{js,_}/main.coffee', './{js,_}/project.coffee']
  css: ['./{css,_}/main.styl']

translations = ['en-us', 'es-mx']

buildDir = './build'


  eventStream = require 'event-stream'
  path = require 'path'

  data =
    require: require # Make local require available in templates.
    t: null # This is where translated strings will go.

  translations.forEach (translation, i) ->
    data.t = require "./translations/#{translation}" # Translated strings

    unless translation.split('.')[0] is defaultTranslation
      localBuildDir = path.join buildDir, translation

    gulp.src files.html
      .pipe ect({data}).on 'error', console.log
      .pipe htmlFileToDirectory()
      .pipe gulp.dest localBuildDir ? buildDir
      .pipe filelog()
  return

