// @author chrisyu@jobkoo.com

// dict
var dict = {
  'This email address has an invalid format': {
    'cn': '输入的邮件格式不正确'
  },
  'Ok': {
    'cn': '确定'
  },
  'en_US': {
    'cn': 'zh_CN'
  },
  'Cancel': {
    'cn': '取消'
  },
  'job title, company, or keyword': {
    'cn': '职位、关键词或公司名称'
  },
  'Sign out': {
    'cn': '注销'
  },
  'Sign in': {
    'cn': '登入'
  },
  'Sign up': {
    'cn': '注册'
  },
  '%job% in %location% ': {
    'cn': '%job% 在 %location%'
  },
  'Get email job alerts': {
    'cn': '创建职位订阅'
  },
  '%cnt% Jobs for': {
    'cn': '共%cnt%个职位'
  },
  'You can save no more than %max% jobs': {
    'cn': '您最多可以保存%max%个职位'
  },
  'You haven\'t saved any jobs yet': {
    'cn': '您还没有保存职位'
  },
  'Search history :': {
    'cn': '我最近搜索的职位：'
  },
  'Clear history': {
    'cn': '清除'
  },
  'Deleting ...': {
    'cn': '正在删除...'
  },
  'Your Job alert has been deleted successfully.': {
    'cn': '已经成功取消了此职位订阅'
  },
  'We WILL NOT send you any job alerts of positions related to these deleted keywords.': {
    'cn': '我们将不会向您发送与此关键词相关的职位订阅信息。'
  },
  'Submitting ...': {
    'cn': '正在提交'
  }
}; //dict

function culture()
{
  c = location.host.split('.')[0];
  switch (c) {
    case 'en':
      return 'en';
    default:
      return 'cn';
  }
}

function __(en, hash)
{
  var ret = en;
  dict[en] && dict[en][culture()] && (ret = dict[en][culture()]);
  
  if (hash) {
    for (k in hash) {
      ret = ret.replace(k, hash[k]);
    }
  }
  
  return ret;
}
