import { createI18n } from 'vue-i18n'

const messages = {
  en: {
    nav: {
      dashboard: 'Dashboard',
      data: 'Data Management',
      signals: 'Signals',
      backtest: 'Backtest',
      settings: 'Settings',
      docs: 'Documentation'
    },
    dashboard: {
      title: 'Dashboard',
      totalReturn: 'Total Return',
      sharpeRatio: 'Sharpe Ratio',
      maxDrawdown: 'Max Drawdown',
      winRate: 'Win Rate',
      goldSilverPrices: 'Gold & Silver Prices',
      gsr: 'Gold-Silver Ratio'
    },
    data: {
      title: 'Data Management',
      fetchData: 'Generate Sample Data',
      startDate: 'Start Date',
      endDate: 'End Date',
      fetch: 'Generate',
      availableData: 'Database Records',
      date: 'Date',
      gold: 'Gold',
      silver: 'Silver',
      gsr: 'GSR',
      regime: 'Regime',
      position: 'Position',
      lowVol: 'Low Vol',
      highVol: 'High Vol'
    },
    signals: {
      title: 'Trading Signals'
    },
    backtest: {
      title: 'Backtest Results',
      run: 'Run Backtest',
      numTrades: 'Number of Trades'
    },
    settings: {
      title: 'Backtest Settings',
      rollingWindow: 'Rolling Window (days)',
      gsrUpper: 'GSR Upper Threshold',
      gsrLower: 'GSR Lower Threshold',
      zscoreThreshold: 'Z-Score Threshold',
      initialCapital: 'Initial Capital ($)',
      save: 'Save Settings',
      saved: 'Settings saved successfully!'
    },
    positions: {
      buy_gold_sell_silver: 'Buy Gold/Sell Silver',
      buy_silver_sell_gold: 'Buy Silver/Sell Gold',
      flat: 'Flat',
      reduced: 'Reduced'
    }
  },
  zh: {
    nav: {
      dashboard: '仪表盘',
      data: '数据管理',
      signals: '交易信号',
      backtest: '回测',
      settings: '设置',
      docs: '系统说明'
    },
    dashboard: {
      title: '仪表盘',
      totalReturn: '总收益',
      sharpeRatio: '夏普比率',
      maxDrawdown: '最大回撤',
      winRate: '胜率',
      goldSilverPrices: '黄金白银价格',
      gsr: '金银比'
    },
    data: {
      title: '数据管理',
      fetchData: '生成模拟数据',
      startDate: '开始日期',
      endDate: '结束日期',
      fetch: '生成',
      availableData: '数据库记录',
      date: '日期',
      gold: '黄金',
      silver: '白银',
      gsr: '金银比',
      regime: '市场状态',
      position: '持仓',
      lowVol: '低波动',
      highVol: '高波动'
    },
    signals: {
      title: '交易信号'
    },
    backtest: {
      title: '回测结果',
      run: '运行回测',
      numTrades: '交易次数'
    },
    settings: {
      title: '回测设置',
      rollingWindow: '滚动窗口 (天)',
      gsrUpper: '金银比上限阈值',
      gsrLower: '金银比下限阈值',
      zscoreThreshold: 'Z分数阈值',
      initialCapital: '初始资金 ($)',
      save: '保存设置',
      saved: '设置保存成功!'
    },
    positions: {
      buy_gold_sell_silver: '买黄金/卖白银',
      buy_silver_sell_gold: '买白银/卖黄金',
      flat: '空仓',
      reduced: '减仓'
    }
  }
}

const i18n = createI18n({
  legacy: false,
  locale: 'zh',
  fallbackLocale: 'en',
  messages
})

export default i18n