lang.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * @author oldj
  3. * @blog http://oldj.net
  4. */
  5. "use strict";
  6. const languages = {
  7. 'en': {
  8. add: 'Add'
  9. , cancel: 'Cancel'
  10. , ok: 'OK'
  11. , add_host: 'Add new rules.'
  12. , edit_host: 'Edit host'
  13. , host_title: 'Host title'
  14. , host_title_cant_be_empty: 'Host title could not be empty!'
  15. , sys_host_title: 'System Hosts'
  16. , input_sudo_pswd: 'Input your sudo password'
  17. , sudo_pswd: 'Password'
  18. , del_host: 'Delete current host'
  19. , confirm_del: 'Are you sure you want to delete this host?'
  20. , tmp_clean: 'Temporarily turn off all rules.'
  21. , tmp_recover: 'Recover rules.'
  22. , new_version_available: 'New version available, download now?'
  23. , is_updated: 'You already have the latest version of SwitchHosts! installed.'
  24. },
  25. 'cn': {
  26. add: '添加'
  27. , cancel: '取消'
  28. , ok: '确定'
  29. , add_host: '添加 host 规则'
  30. , edit_host: '修改 host'
  31. , host_title: 'host 方案名'
  32. , host_title_cant_be_empty: 'Host 方案名不能为空!'
  33. , sys_host_title: '系统 Hosts'
  34. , input_sudo_pswd: '请输入管理员密码'
  35. , sudo_pswd: '密码'
  36. , del_host: '删除当前 host'
  37. , confirm_del: '确定要删除此 host 吗?'
  38. , tmp_clean: '临时去掉所有绑定'
  39. , tmp_recover: '恢复绑定'
  40. , new_version_available: '检测到新版本,是否要下载?'
  41. , is_updated: '当前版本是最新版本。'
  42. }
  43. };
  44. module.exports = {
  45. languages: languages,
  46. getLang: function (lang) {
  47. lang = lang.toLowerCase();
  48. if (lang == 'cn' || lang == 'zh-cn') {
  49. lang = 'cn';
  50. } else {
  51. lang = 'en';
  52. }
  53. return languages[lang] || languages['en'];
  54. }
  55. };