/**
 * 模块化翻译系统
 * Modular Translation System
 * 
 * 架构说明：
 * - 每个应用模块有独立的翻译文件
 * - 公共翻译在 common 目录
 * - 使用时按需加载，避免加载所有翻译
 */

import { commonZh } from './common/zh';
import { commonEn } from './common/en';
import { navZh } from './nav/zh';
import { navEn } from './nav/en';
import { dashboardZh } from './dashboard/zh';
import { dashboardEn } from './dashboard/en';
import { authZh } from './auth/zh';
import { authEn } from './auth/en';
import { organizationZh } from './organization/zh';
import { organizationEn } from './organization/en';
import { partsZh } from './parts/zh';
import { partsEn } from './parts/en';
import { approvalsZh } from './approvals/zh';
import { approvalsEn } from './approvals/en';
import { inventoryZh } from './inventory/zh';
import { inventoryEn } from './inventory/en';
import { labelsZh } from './labels/zh';
import { labelsEn } from './labels/en';
import { scanZh } from './scan/zh';
import { scanEn } from './scan/en';
import { alertsZh } from './alerts/zh';
import { alertsEn } from './alerts/en';
import { automationZh } from './automation/zh';
import { automationEn } from './automation/en';
import { usersZh } from './users/zh';
import { usersEn } from './users/en';
import { warehouseZh } from './warehouse/zh';
import { warehouseEn } from './warehouse/en';
import { stationZh } from './station/zh';
import { stationEn } from './station/en';
import formsZh from './forms/zh';
import formsEn from './forms/en';
import { zh as feedbackZh } from './feedback/zh';
import { en as feedbackEn } from './feedback/en';
import { zh as internalAppsZh } from './internalApps/zh';
import { en as internalAppsEn } from './internalApps/en';
import { zh as ticketsZh } from './tickets/zh';
import { en as ticketsEn } from './tickets/en';
import { aiAssistantZh } from './aiAssistant/zh';
import { aiAssistantEn } from './aiAssistant/en';
import { auditZh } from './audit/zh';
import { auditEn } from './audit/en';
import { logsZh } from './logs/zh';
import { logsEn } from './logs/en';
import { knowledgeBaseZh } from './knowledgeBase/zh';
import { knowledgeBaseEn } from './knowledgeBase/en';
import { batchImportDeptZh } from './batchImportDept/zh';
import { batchImportDeptEn } from './batchImportDept/en';
import { batchImportUserMembershipsZh } from './batchImportUserMemberships/zh';
import { batchImportUserMembershipsEn } from './batchImportUserMemberships/en';
import { performanceZh } from './performance/zh';
import { performanceEn } from './performance/en';
import { documentEditorZh } from './documentEditor/zh';
import { documentEditorEn } from './documentEditor/en';
import { notificationsZh } from './notifications/zh';
import { notificationsEn } from './notifications/en';
import { purchasesZh } from './purchases/zh';
import { purchasesEn } from './purchases/en';
import { expensesZh } from './expenses/zh';
import { expensesEn } from './expenses/en';
import { contractsZh } from './contracts/zh';
import { contractsEn } from './contracts/en';
import { zh as devtrackerZh } from './devtracker/zh';
import { en as devtrackerEn } from './devtracker/en';
import { meetingAttendanceZh } from './meetingAttendance/zh';
import { meetingAttendanceEn } from './meetingAttendance/en';
import { siteAttendanceZh } from './site-attendance/zh';
import { siteAttendanceEn } from './site-attendance/en';
import { robotManagerZh } from './robot-manager/zh';
import { robotManagerEn } from './robot-manager/en';
import { opsCenterZh } from './ops-center/zh';
import { opsCenterEn } from './ops-center/en';
import { syncCenterZh } from './syncCenter/zh';
import { syncCenterEn } from './syncCenter/en';
import { iamGovernanceZh } from './iamGovernance/zh';
import { iamGovernanceEn } from './iamGovernance/en';
import { iamAdminZh } from './iamAdmin/zh';
import { iamAdminEn } from './iamAdmin/en';
import { aiUsageZh } from './aiUsage/zh';
import { aiUsageEn } from './aiUsage/en';
import { agentZh } from './agent/zh';
import { agentEn } from './agent/en';

// 定义 Locale 类型
export type Locale = 'zh' | 'en';

// 定义翻译结构
export interface Translations {
  locale: Locale;
  common: typeof commonZh;
  nav: typeof navZh;
  dashboard: typeof dashboardZh;
  auth: typeof authZh;
  organization: typeof organizationZh;
  parts: typeof partsZh;
  approvals: typeof approvalsZh;
  inventory: typeof inventoryZh;
  labels: typeof labelsZh;
  scan: typeof scanZh;
  alerts: typeof alertsZh;
  automation: typeof automationZh;
  users: typeof usersZh;
  warehouse: typeof warehouseZh;
  station: typeof stationZh;
  forms: typeof formsZh;
  feedback: typeof feedbackZh;
  internalApps: typeof internalAppsZh;
  tickets: typeof ticketsZh;
  aiAssistant: typeof aiAssistantZh;
  audit: typeof auditZh;
  logs: typeof logsZh;
  knowledgeBase: typeof knowledgeBaseZh;
  batchImportDept: typeof batchImportDeptZh;
  batchImportUserMemberships: typeof batchImportUserMembershipsZh;
  performance: typeof performanceZh;
  documentEditor: typeof documentEditorZh;
  notifications: typeof notificationsZh;
  purchases: typeof purchasesZh;
  expenses: typeof expensesZh;
  contracts: typeof contractsZh;
  devtracker: typeof devtrackerZh;
  meetingAttendance: typeof meetingAttendanceZh;
  siteAttendance: typeof siteAttendanceZh;
  robotManager: typeof robotManagerZh;
  opsCenter: typeof opsCenterZh;
  syncCenter: typeof syncCenterZh;
  iamGovernance: typeof iamGovernanceZh;
  iamAdmin: typeof iamAdminZh;
  aiUsage: typeof aiUsageZh;
  agent: typeof agentZh;
}

// 中文翻译
const zh: Translations = {
  locale: 'zh',
  common: commonZh,
  nav: navZh,
  dashboard: dashboardZh,
  auth: authZh,
  organization: organizationZh,
  parts: partsZh,
  approvals: approvalsZh,
  inventory: inventoryZh,
  labels: labelsZh,
  scan: scanZh,
  alerts: alertsZh,
  automation: automationZh,
  users: usersZh,
  warehouse: warehouseZh,
  station: stationZh,
  forms: formsZh,
  feedback: feedbackZh,
  internalApps: internalAppsZh,
  tickets: ticketsZh,
  aiAssistant: aiAssistantZh,
  audit: auditZh,
  logs: logsZh,
  knowledgeBase: knowledgeBaseZh,
  batchImportDept: batchImportDeptZh,
  batchImportUserMemberships: batchImportUserMembershipsZh,
  performance: performanceZh,
  documentEditor: documentEditorZh,
  notifications: notificationsZh,
  purchases: purchasesZh,
  expenses: expensesZh,
  contracts: contractsZh,
  devtracker: devtrackerZh,
  meetingAttendance: meetingAttendanceZh,
  siteAttendance: siteAttendanceZh,
  robotManager: robotManagerZh,
  opsCenter: opsCenterZh,
  syncCenter: syncCenterZh,
  iamGovernance: iamGovernanceZh,
  iamAdmin: iamAdminZh,
  aiUsage: aiUsageZh,
  agent: agentZh,
};

// 英文翻译
const en: Translations = {
  locale: 'en',
  common: commonEn,
  nav: navEn,
  dashboard: dashboardEn,
  auth: authEn,
  organization: organizationEn,
  parts: partsEn,
  approvals: approvalsEn,
  inventory: inventoryEn,
  labels: labelsEn,
  scan: scanEn,
  alerts: alertsEn,
  automation: automationEn,
  users: usersEn,
  warehouse: warehouseEn,
  station: stationEn,
  forms: formsEn,
  feedback: feedbackEn,
  internalApps: internalAppsEn,
  tickets: ticketsEn,
  aiAssistant: aiAssistantEn,
  audit: auditEn,
  logs: logsEn,
  knowledgeBase: knowledgeBaseEn,
  batchImportDept: batchImportDeptEn,
  batchImportUserMemberships: batchImportUserMembershipsEn,
  performance: performanceEn,
  documentEditor: documentEditorEn,
  notifications: notificationsEn,
  purchases: purchasesEn,
  expenses: expensesEn,
  contracts: contractsEn,
  devtracker: devtrackerEn,
  meetingAttendance: meetingAttendanceEn,
  siteAttendance: siteAttendanceEn,
  robotManager: robotManagerEn,
  opsCenter: opsCenterEn,
  syncCenter: syncCenterEn,
  iamGovernance: iamGovernanceEn,
  iamAdmin: iamAdminEn,
  aiUsage: aiUsageEn,
  agent: agentEn,
};

// 翻译映射
const translations: Record<Locale, Translations> = {
  zh,
  en,
};

// 导出翻译获取函数
export function getTranslations(locale: Locale): Translations {
  return translations[locale] || translations.zh;
}

// 导出类型
export type TranslationKeys = Translations;

// 默认导出
export default translations;
