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()
@@ -940,16 +940,66 @@
   return
+ (typeof translations%5Bself.lang%5D != 'undefined') ?
  mustach
@@ -1043,18 +1043,17 @@
 , data) 
-%7C%7C
+:
  mustach
@@ -1116,16 +1116,17 @@
 rts = new Lang()
+%0A

Update lang.js