460 lines
13 KiB
Dart
460 lines
13 KiB
Dart
/// Genex Admin App (Issuer) - i18n 多语言支持
|
|
///
|
|
/// 支持语言: zh-CN (默认), en-US, ja-JP
|
|
/// 使用方式: AppLocalizations.of(context).translate('key')
|
|
/// 包含: 通用键 + 发行方专用键
|
|
|
|
class AppLocalizations {
|
|
final String locale;
|
|
|
|
AppLocalizations(this.locale);
|
|
|
|
static AppLocalizations of(dynamic context) {
|
|
// In production, obtain from InheritedWidget / Provider
|
|
return AppLocalizations('zh-CN');
|
|
}
|
|
|
|
String translate(String key) {
|
|
return _localizedValues[locale]?[key] ??
|
|
_localizedValues['zh-CN']?[key] ??
|
|
key;
|
|
}
|
|
|
|
// Shorthand
|
|
String t(String key) => translate(key);
|
|
|
|
static const supportedLocales = ['zh-CN', 'en-US', 'ja-JP'];
|
|
|
|
static const Map<String, Map<String, String>> _localizedValues = {
|
|
'zh-CN': _zhCN,
|
|
'en-US': _enUS,
|
|
'ja-JP': _jaJP,
|
|
};
|
|
|
|
static const Map<String, String> _zhCN = {
|
|
// Common
|
|
'app_name': 'Genex',
|
|
'confirm': '确认',
|
|
'cancel': '取消',
|
|
'save': '保存',
|
|
'delete': '删除',
|
|
'edit': '编辑',
|
|
'search': '搜索',
|
|
'loading': '加载中...',
|
|
'retry': '重试',
|
|
'done': '完成',
|
|
'next': '下一步',
|
|
'back': '返回',
|
|
'close': '关闭',
|
|
'more': '更多',
|
|
'all': '全部',
|
|
|
|
// Tabs
|
|
'tab_home': '首页',
|
|
'tab_market': '市场',
|
|
'tab_wallet': '钱包',
|
|
'tab_profile': '我的',
|
|
|
|
// Home
|
|
'home_greeting': '你好',
|
|
'home_search_hint': '搜索券、品牌...',
|
|
'home_recommended': 'AI推荐',
|
|
'home_hot': '热门券',
|
|
'home_new': '新上架',
|
|
'home_categories': '分类浏览',
|
|
|
|
// Coupon
|
|
'coupon_buy': '购买',
|
|
'coupon_sell': '出售',
|
|
'coupon_transfer': '转赠',
|
|
'coupon_use': '使用',
|
|
'coupon_detail': '券详情',
|
|
'coupon_face_value': '面值',
|
|
'coupon_price': '价格',
|
|
'coupon_discount': '折扣',
|
|
'coupon_valid_until': '有效期至',
|
|
'coupon_brand': '品牌',
|
|
'coupon_category': '类别',
|
|
'coupon_my_coupons': '我的券',
|
|
'coupon_available': '可用',
|
|
'coupon_used': '已使用',
|
|
'coupon_expired': '已过期',
|
|
|
|
// Trading
|
|
'trade_buy_order': '买单',
|
|
'trade_sell_order': '卖单',
|
|
'trade_price_input': '输入价格',
|
|
'trade_quantity': '数量',
|
|
'trade_total': '合计',
|
|
'trade_history': '交易记录',
|
|
'trade_pending': '待成交',
|
|
'trade_completed': '已完成',
|
|
|
|
// Wallet
|
|
'wallet_balance': '余额',
|
|
'wallet_deposit': '充值',
|
|
'wallet_withdraw': '提现',
|
|
'wallet_transactions': '交易记录',
|
|
|
|
// Profile
|
|
'profile_settings': '设置',
|
|
'profile_kyc': '身份认证',
|
|
'profile_kyc_l0': '未认证',
|
|
'profile_kyc_l1': 'L1 基础认证',
|
|
'profile_kyc_l2': 'L2 身份认证',
|
|
'profile_kyc_l3': 'L3 高级认证',
|
|
'profile_language': '语言',
|
|
'profile_currency': '货币',
|
|
'profile_help': '帮助中心',
|
|
'profile_about': '关于',
|
|
'profile_logout': '退出登录',
|
|
'profile_pro_mode': '高级模式',
|
|
|
|
// Payment
|
|
'payment_method': '支付方式',
|
|
'payment_confirm': '确认支付',
|
|
'payment_success': '支付成功',
|
|
|
|
// AI
|
|
'ai_assistant': 'AI助手',
|
|
'ai_ask': '问我任何问题...',
|
|
'ai_suggestion': 'AI建议',
|
|
|
|
// ── Issuer-specific ──
|
|
'issuer_dashboard': '数据概览',
|
|
'issuer_coupons': '券管理',
|
|
'issuer_redeem': '核销',
|
|
'issuer_finance': '财务',
|
|
'issuer_profile': '我的',
|
|
'issuer_onboarding': '入驻申请',
|
|
'issuer_credit': '信用评级',
|
|
'batch_issue': '批量发行',
|
|
'batch_recall': '批量召回',
|
|
'reconciliation': '对账',
|
|
'store_management': '门店管理',
|
|
|
|
// Issuer Dashboard
|
|
'issuer_total_issued': '已发行总量',
|
|
'issuer_total_redeemed': '已核销总量',
|
|
'issuer_active_coupons': '流通中',
|
|
'issuer_revenue': '收入',
|
|
'issuer_today_stats': '今日数据',
|
|
'issuer_weekly_stats': '本周数据',
|
|
'issuer_monthly_stats': '本月数据',
|
|
|
|
// Coupon Management
|
|
'issuer_create_coupon': '创建券',
|
|
'issuer_coupon_template': '券模板',
|
|
'issuer_coupon_status': '券状态',
|
|
'issuer_coupon_active': '生效中',
|
|
'issuer_coupon_paused': '已暂停',
|
|
'issuer_coupon_recalled': '已召回',
|
|
|
|
// Redemption
|
|
'issuer_scan_qr': '扫码核销',
|
|
'issuer_manual_redeem': '手动核销',
|
|
'issuer_redeem_history': '核销记录',
|
|
'issuer_redeem_success': '核销成功',
|
|
'issuer_redeem_failed': '核销失败',
|
|
|
|
// Store Management
|
|
'store_add': '添加门店',
|
|
'store_edit': '编辑门店',
|
|
'store_name': '门店名称',
|
|
'store_address': '门店地址',
|
|
'store_staff': '员工管理',
|
|
'store_device': '设备管理',
|
|
|
|
// Finance
|
|
'finance_settlement': '结算',
|
|
'finance_settlement_pending': '待结算',
|
|
'finance_settlement_completed': '已结算',
|
|
'finance_invoice': '发票',
|
|
'finance_report': '财务报表',
|
|
};
|
|
|
|
static const Map<String, String> _enUS = {
|
|
// Common
|
|
'app_name': 'Genex',
|
|
'confirm': 'Confirm',
|
|
'cancel': 'Cancel',
|
|
'save': 'Save',
|
|
'delete': 'Delete',
|
|
'edit': 'Edit',
|
|
'search': 'Search',
|
|
'loading': 'Loading...',
|
|
'retry': 'Retry',
|
|
'done': 'Done',
|
|
'next': 'Next',
|
|
'back': 'Back',
|
|
'close': 'Close',
|
|
'more': 'More',
|
|
'all': 'All',
|
|
|
|
// Tabs
|
|
'tab_home': 'Home',
|
|
'tab_market': 'Market',
|
|
'tab_wallet': 'Wallet',
|
|
'tab_profile': 'Profile',
|
|
|
|
// Home
|
|
'home_greeting': 'Hello',
|
|
'home_search_hint': 'Search coupons, brands...',
|
|
'home_recommended': 'AI Picks',
|
|
'home_hot': 'Trending',
|
|
'home_new': 'New Arrivals',
|
|
'home_categories': 'Categories',
|
|
|
|
// Coupon
|
|
'coupon_buy': 'Buy',
|
|
'coupon_sell': 'Sell',
|
|
'coupon_transfer': 'Gift',
|
|
'coupon_use': 'Redeem',
|
|
'coupon_detail': 'Coupon Details',
|
|
'coupon_face_value': 'Face Value',
|
|
'coupon_price': 'Price',
|
|
'coupon_discount': 'Discount',
|
|
'coupon_valid_until': 'Valid Until',
|
|
'coupon_brand': 'Brand',
|
|
'coupon_category': 'Category',
|
|
'coupon_my_coupons': 'My Coupons',
|
|
'coupon_available': 'Available',
|
|
'coupon_used': 'Used',
|
|
'coupon_expired': 'Expired',
|
|
|
|
// Trading
|
|
'trade_buy_order': 'Buy Order',
|
|
'trade_sell_order': 'Sell Order',
|
|
'trade_price_input': 'Enter Price',
|
|
'trade_quantity': 'Quantity',
|
|
'trade_total': 'Total',
|
|
'trade_history': 'Trade History',
|
|
'trade_pending': 'Pending',
|
|
'trade_completed': 'Completed',
|
|
|
|
// Wallet
|
|
'wallet_balance': 'Balance',
|
|
'wallet_deposit': 'Deposit',
|
|
'wallet_withdraw': 'Withdraw',
|
|
'wallet_transactions': 'Transactions',
|
|
|
|
// Profile
|
|
'profile_settings': 'Settings',
|
|
'profile_kyc': 'Verification',
|
|
'profile_kyc_l0': 'Unverified',
|
|
'profile_kyc_l1': 'L1 Basic',
|
|
'profile_kyc_l2': 'L2 Identity',
|
|
'profile_kyc_l3': 'L3 Advanced',
|
|
'profile_language': 'Language',
|
|
'profile_currency': 'Currency',
|
|
'profile_help': 'Help Center',
|
|
'profile_about': 'About',
|
|
'profile_logout': 'Log Out',
|
|
'profile_pro_mode': 'Pro Mode',
|
|
|
|
// Payment
|
|
'payment_method': 'Payment Method',
|
|
'payment_confirm': 'Confirm Payment',
|
|
'payment_success': 'Payment Successful',
|
|
|
|
// AI
|
|
'ai_assistant': 'AI Assistant',
|
|
'ai_ask': 'Ask me anything...',
|
|
'ai_suggestion': 'AI Suggestion',
|
|
|
|
// ── Issuer-specific ──
|
|
'issuer_dashboard': 'Dashboard',
|
|
'issuer_coupons': 'Coupon Management',
|
|
'issuer_redeem': 'Redemption',
|
|
'issuer_finance': 'Finance',
|
|
'issuer_profile': 'My Profile',
|
|
'issuer_onboarding': 'Onboarding',
|
|
'issuer_credit': 'Credit Rating',
|
|
'batch_issue': 'Batch Issue',
|
|
'batch_recall': 'Batch Recall',
|
|
'reconciliation': 'Reconciliation',
|
|
'store_management': 'Store Management',
|
|
|
|
// Issuer Dashboard
|
|
'issuer_total_issued': 'Total Issued',
|
|
'issuer_total_redeemed': 'Total Redeemed',
|
|
'issuer_active_coupons': 'In Circulation',
|
|
'issuer_revenue': 'Revenue',
|
|
'issuer_today_stats': 'Today',
|
|
'issuer_weekly_stats': 'This Week',
|
|
'issuer_monthly_stats': 'This Month',
|
|
|
|
// Coupon Management
|
|
'issuer_create_coupon': 'Create Coupon',
|
|
'issuer_coupon_template': 'Coupon Template',
|
|
'issuer_coupon_status': 'Coupon Status',
|
|
'issuer_coupon_active': 'Active',
|
|
'issuer_coupon_paused': 'Paused',
|
|
'issuer_coupon_recalled': 'Recalled',
|
|
|
|
// Redemption
|
|
'issuer_scan_qr': 'Scan QR Code',
|
|
'issuer_manual_redeem': 'Manual Redemption',
|
|
'issuer_redeem_history': 'Redemption History',
|
|
'issuer_redeem_success': 'Redemption Successful',
|
|
'issuer_redeem_failed': 'Redemption Failed',
|
|
|
|
// Store Management
|
|
'store_add': 'Add Store',
|
|
'store_edit': 'Edit Store',
|
|
'store_name': 'Store Name',
|
|
'store_address': 'Store Address',
|
|
'store_staff': 'Staff Management',
|
|
'store_device': 'Device Management',
|
|
|
|
// Finance
|
|
'finance_settlement': 'Settlement',
|
|
'finance_settlement_pending': 'Pending Settlement',
|
|
'finance_settlement_completed': 'Settled',
|
|
'finance_invoice': 'Invoice',
|
|
'finance_report': 'Financial Report',
|
|
};
|
|
|
|
static const Map<String, String> _jaJP = {
|
|
// Common
|
|
'app_name': 'Genex',
|
|
'confirm': '確認',
|
|
'cancel': 'キャンセル',
|
|
'save': '保存',
|
|
'delete': '削除',
|
|
'edit': '編集',
|
|
'search': '検索',
|
|
'loading': '読み込み中...',
|
|
'retry': 'リトライ',
|
|
'done': '完了',
|
|
'next': '次へ',
|
|
'back': '戻る',
|
|
'close': '閉じる',
|
|
'more': 'もっと見る',
|
|
'all': 'すべて',
|
|
|
|
// Tabs
|
|
'tab_home': 'ホーム',
|
|
'tab_market': 'マーケット',
|
|
'tab_wallet': 'ウォレット',
|
|
'tab_profile': 'マイページ',
|
|
|
|
// Home
|
|
'home_greeting': 'こんにちは',
|
|
'home_search_hint': 'クーポン、ブランドを検索...',
|
|
'home_recommended': 'AIおすすめ',
|
|
'home_hot': '人気',
|
|
'home_new': '新着',
|
|
'home_categories': 'カテゴリー',
|
|
|
|
// Coupon
|
|
'coupon_buy': '購入',
|
|
'coupon_sell': '売却',
|
|
'coupon_transfer': '贈与',
|
|
'coupon_use': '使用',
|
|
'coupon_detail': 'クーポン詳細',
|
|
'coupon_face_value': '額面',
|
|
'coupon_price': '価格',
|
|
'coupon_discount': '割引',
|
|
'coupon_valid_until': '有効期限',
|
|
'coupon_brand': 'ブランド',
|
|
'coupon_category': 'カテゴリー',
|
|
'coupon_my_coupons': 'マイクーポン',
|
|
'coupon_available': '利用可能',
|
|
'coupon_used': '使用済み',
|
|
'coupon_expired': '期限切れ',
|
|
|
|
// Trading
|
|
'trade_buy_order': '買い注文',
|
|
'trade_sell_order': '売り注文',
|
|
'trade_price_input': '価格を入力',
|
|
'trade_quantity': '数量',
|
|
'trade_total': '合計',
|
|
'trade_history': '取引履歴',
|
|
'trade_pending': '未約定',
|
|
'trade_completed': '約定済み',
|
|
|
|
// Wallet
|
|
'wallet_balance': '残高',
|
|
'wallet_deposit': '入金',
|
|
'wallet_withdraw': '出金',
|
|
'wallet_transactions': '取引履歴',
|
|
|
|
// Profile
|
|
'profile_settings': '設定',
|
|
'profile_kyc': '本人確認',
|
|
'profile_kyc_l0': '未確認',
|
|
'profile_kyc_l1': 'L1 基本認証',
|
|
'profile_kyc_l2': 'L2 身分認証',
|
|
'profile_kyc_l3': 'L3 高度認証',
|
|
'profile_language': '言語',
|
|
'profile_currency': '通貨',
|
|
'profile_help': 'ヘルプ',
|
|
'profile_about': 'アプリについて',
|
|
'profile_logout': 'ログアウト',
|
|
'profile_pro_mode': 'プロモード',
|
|
|
|
// Payment
|
|
'payment_method': '支払い方法',
|
|
'payment_confirm': '支払いを確認',
|
|
'payment_success': '支払い完了',
|
|
|
|
// AI
|
|
'ai_assistant': 'AIアシスタント',
|
|
'ai_ask': '何でも聞いてください...',
|
|
'ai_suggestion': 'AIの提案',
|
|
|
|
// ── Issuer-specific ──
|
|
'issuer_dashboard': 'ダッシュボード',
|
|
'issuer_coupons': 'クーポン管理',
|
|
'issuer_redeem': '検証',
|
|
'issuer_finance': '財務',
|
|
'issuer_profile': 'マイページ',
|
|
'issuer_onboarding': '申請',
|
|
'issuer_credit': '信用格付け',
|
|
'batch_issue': '一括発行',
|
|
'batch_recall': '一括リコール',
|
|
'reconciliation': '照合',
|
|
'store_management': '店舗管理',
|
|
|
|
// Issuer Dashboard
|
|
'issuer_total_issued': '発行総数',
|
|
'issuer_total_redeemed': '検証総数',
|
|
'issuer_active_coupons': '流通中',
|
|
'issuer_revenue': '収益',
|
|
'issuer_today_stats': '本日',
|
|
'issuer_weekly_stats': '今週',
|
|
'issuer_monthly_stats': '今月',
|
|
|
|
// Coupon Management
|
|
'issuer_create_coupon': 'クーポン作成',
|
|
'issuer_coupon_template': 'クーポンテンプレート',
|
|
'issuer_coupon_status': 'クーポンステータス',
|
|
'issuer_coupon_active': '有効',
|
|
'issuer_coupon_paused': '一時停止',
|
|
'issuer_coupon_recalled': 'リコール済み',
|
|
|
|
// Redemption
|
|
'issuer_scan_qr': 'QRコードスキャン',
|
|
'issuer_manual_redeem': '手動検証',
|
|
'issuer_redeem_history': '検証履歴',
|
|
'issuer_redeem_success': '検証成功',
|
|
'issuer_redeem_failed': '検証失敗',
|
|
|
|
// Store Management
|
|
'store_add': '店舗追加',
|
|
'store_edit': '店舗編集',
|
|
'store_name': '店舗名',
|
|
'store_address': '店舗住所',
|
|
'store_staff': 'スタッフ管理',
|
|
'store_device': 'デバイス管理',
|
|
|
|
// Finance
|
|
'finance_settlement': '決済',
|
|
'finance_settlement_pending': '未決済',
|
|
'finance_settlement_completed': '決済済み',
|
|
'finance_invoice': '請求書',
|
|
'finance_report': '財務レポート',
|
|
};
|
|
}
|