// 语言配置文件
export type Language = 'zh' | 'en';

export const translations = {
  zh: {
    // 登录页面
    login: {
      title: '能量隔离系统',
      subtitle: 'ENERGY ISOLATION SYSTEM',
      slogan1: '智能守护',
      slogan2: '能量未来',
      description: '采用先进的能量监控与隔离技术，实时追踪能量流动，为您的系统提供全天候智能防护解决方案',
      feature1Title: '实时监控',
      feature1Desc: '24/7全天候监测',
      feature2Title: '远程控制',
      feature2Desc: '随时随地管理设备',
      feature3Title: '数据安全',
      feature3Desc: '企业级加密防护',
      securityLevel: '安全等级',
      responseSpeed: '响应速度',
      systemVersion: '系统版本',
      enterpriseGrade: '企业级',
      tenant: '请输入企业',
      username: '用户名',
      usernamePlaceholder: '请输入用户名',
      password: '密码',
      passwordPlaceholder: '请输入密码',
      rememberMe: '记住我',
      forgotPassword: '忘记密码？',
      loginButton: '登录系统',
      loggingIn: '登录中...',
      systemNotice: '系统升级通知',
      noticeContent: 'v1.0 版本上线，欢迎体验能量隔离系统',
      help: '需要帮助？联系技术支持',
      copyright: '© 2025 Energy Isolation System. All rights reserved.',
      newGeneration: '⚡ 新一代智能防护系统',
    },
    // 重置密码页面
    reset: {
      title: '重置密码',
      subtitle: '请填写以下信息以重置您的密码',
      company: '请输入企业名称 *',
      phone: '请输入手机号码 *',
      code: '请输入验证码 *',
      sendCode: '发送验证码',
      newPassword: '请输入新密码 *',
      confirmPassword: '确认密码 *',
      passwordStrength: '密码强度',
      weak: '弱',
      medium: '中',
      strong: '强',
      notEntered: '未输入',
      passwordMatch: '✓ 密码一致',
      passwordMismatch: '✗ 密码不一致',
      backButton: '返回',
      resetButton: '重置密码',
      securityTip: '安全提示：',
      securityHint: '密码长度至少6位，建议包含大小写字母、数字和特殊字符以提高安全性。',
    },
    // 后台导航
    nav: {
      systemConfig: '系统配置',
      userManagement: '用户管理',
      hardwareManagement: '硬件管理',
      locationManagement: '点位管理',
      isolationWork: '隔离作业',
      profile: '个人中心',
      settings: '账号设置',
      logout: '退出登录',
      notifications: '通知',
    },
    // 系统配置子菜单
    systemConfig: {
      menuManagement: '菜单管理',
      departmentManagement: '部门管理',
      roleManagement: '角色管理',
      dictionaryManagement: '字典管理',
      cabinetManagement: '机柜管理',
    },
    // 用户管理子菜单
    userManagement: {
      userList: '用户列表',
      notificationManagement: '通知管理',
    },
    // 硬件管理子菜单
    hardwareManagement: {
      cabinet: '机柜',
      key: '钥匙',
      padlock: '挂锁',
      portable: '便携式',
    },
    // 隔离作业子菜单
    isolationWork: {
      processTemplate: '流程模板',
      sopManagement: 'SOP管理',
      workManagement: '作业管理',
    },
  },
  en: {
    // Login page
    login: {
      title: 'Energy Isolation System',
      subtitle: 'ENERGY ISOLATION SYSTEM',
      slogan1: 'Smart Protection',
      slogan2: 'Energy Future',
      description: 'Advanced energy monitoring and isolation technology, real-time energy flow tracking, providing 24/7 intelligent protection solutions for your system',
      feature1Title: 'Real-time Monitoring',
      feature1Desc: '24/7 Surveillance',
      feature2Title: 'Remote Control',
      feature2Desc: 'Manage Anytime',
      feature3Title: 'Data Security',
      feature3Desc: 'Enterprise Encryption',
      securityLevel: 'Security Level',
      responseSpeed: 'Response Speed',
      systemVersion: 'Version',
      enterpriseGrade: 'Enterprise',
      tenant: 'Enter Company',
      username: 'Username',
      usernamePlaceholder: 'Enter Username',
      password: 'Password',
      passwordPlaceholder: 'Enter Password',
      rememberMe: 'Remember Me',
      forgotPassword: 'Forgot Password?',
      loginButton: 'Login',
      loggingIn: 'Logging in...',
      systemNotice: 'System Update',
      noticeContent: 'v1.0 is now live, welcome to Energy Isolation System',
      help: 'Need help? Contact Support',
      copyright: '© 2025 Energy Isolation System. All rights reserved.',
      newGeneration: '⚡ Next-Gen Smart Protection',
    },
    // Reset password page
    reset: {
      title: 'Reset Password',
      subtitle: 'Please fill in the following information to reset your password',
      company: 'Enter Company Name *',
      phone: 'Enter Phone Number *',
      code: 'Enter Verification Code *',
      sendCode: 'Send Code',
      newPassword: 'Enter New Password *',
      confirmPassword: 'Confirm Password *',
      passwordStrength: 'Strength',
      weak: 'Weak',
      medium: 'Medium',
      strong: 'Strong',
      notEntered: 'None',
      passwordMatch: '✓ Match',
      passwordMismatch: '✗ Mismatch',
      backButton: 'Back',
      resetButton: 'Reset Password',
      securityTip: 'Security Tip: ',
      securityHint: 'Password must be at least 6 characters. Include uppercase, lowercase, numbers and special characters for better security.',
    },
    // Navigation
    nav: {
      systemConfig: 'System Config',
      userManagement: 'User Management',
      hardwareManagement: 'Hardware',
      locationManagement: 'Location',
      isolationWork: 'Isolation Work',
      profile: 'Profile',
      settings: 'Settings',
      logout: 'Logout',
      notifications: 'Notifications',
    },
    // System Config Submenu
    systemConfig: {
      menuManagement: 'Menu',
      departmentManagement: 'Department',
      roleManagement: 'Role',
      dictionaryManagement: 'Dictionary',
      cabinetManagement: 'Cabinet',
    },
    // User Management Submenu
    userManagement: {
      userList: 'User List',
      notificationManagement: 'Notifications',
    },
    // Hardware Management Submenu
    hardwareManagement: {
      cabinet: 'Cabinet',
      key: 'Key',
      padlock: 'Padlock',
      portable: 'Portable',
    },
    // Isolation Work Submenu
    isolationWork: {
      processTemplate: 'Process Template',
      sopManagement: 'SOP',
      workManagement: 'Work Management',
    },
  },
};

export const getTranslation = (lang: Language, key: string) => {
  const keys = key.split('.');
  let value: any = translations[lang];
  
  for (const k of keys) {
    value = value?.[k];
  }
  
  return value || key;
};
