old_contents: var translations = require('./translations')
  
  var mustache = require('mustache')
  var EventEmitter = require('events').EventEmitter
  var inherits = require('inherits')
  
  inherits(Lang, EventEmitter)
  
  function Lang () {
    var self = this
    if (!(self instanceof Lang)) return new Lang()
  
    var langLocale = navigator.languages
      ? navigator.languages[0]
      : (navigator.language || navigator.userLanguage)
    
    self.lang = langLocale.split('-')[0]
    self.locale = langLocale.split('-')[1] // TODO: locale support
    
    
    // translate the DOM
    document.querySelector('#save > span').innerHTML = self.get('save')
    document.querySelector('#deploy > span').innerHTML = self.get('deploy')
    document.querySelector('#voice > span').innerHTML = self.get('talk')
    document.querySelector('#save > span').innerHTML = self.get('save')
  }
  
  Lang.prototype.get = function (key, data) {
    var self = this
    
    data = data || {}
    
    console.log(key)
    
    return mustache.render(translations[self.lang][key], data) || mustache.render(translations['en'][key], data)
  }
    
  module.exports = new Lang()
new_contents: var translations = require('./translations')
  
  var mustache = require('mustache')
  var EventEmitter = require('events').EventEmitter
  var inherits = require('inherits')
  
  inherits(Lang, EventEmitter)
  
  function Lang () {
    var self = this
    if (!(self instanceof Lang)) return new Lang()
  
    var langLocale = navigator.languages
      ? navigator.languages[0]
      : (navigator.language || navigator.userLanguage)
    
    self.lang = langLocale.split('-')[0]
    self.locale = langLocale.split('-')[1] // TODO: locale support
    
    
    // translate the DOM
    document.querySelector('#save > span').innerHTML = self.get('save')
    document.querySelector('#deploy > span').innerHTML = self.get('deploy')
    document.querySelector('#voice > span').innerHTML = self.get('talk')
    document.querySelector('#save > span').innerHTML = self.get('save')
  }
  
  Lang.prototype.get = function (key, data) {
    var self = this
    
    data = data || {}
    
    console.log(key)
    
    return (typeof translations[self.lang] != 'undefined') ? mustache.render(translations[self.lang][key], data) : mustache.render(translations['en'][key], data)
  }
    
  module.exports = new Lang()
  
subject: Update lang.js