   js: ['./{js,_}/main.coffee', './{js,_}/project.coffee']
   css: ['./{css,_}/main.styl']
 
-translations = ['en-us', 'es-mx']
+defaultTranslation = 'en-us'
+translations = fs.readdirSync './translations'
+  .map (file) ->
+    file.split('.')[0]
 
 buildDir = './build'
 

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

  translations.forEach (translation, i) ->
    data =
      require: require # Make local require available in templates.
      t: require "./translations/#{translation}" # Translated strings

    gulp.src files.html
      .pipe ect({data}).on 'error', console.log
      .pipe htmlFileToDirectory()
      .pipe eventStream.map (file, callback) ->
        unless i is 0
          # TODO: This feels pretty hacky.
          file.path = file.path.replace file.base, path.join(file.base, translation) + path.sep
        callback null, file
      .pipe gulp.dest buildDir
      .pipe filelog()
  return


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