/// Genex Mobile App - 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> _localizedValues = { 'zh-CN': _zhCN, 'en-US': _enUS, 'ja-JP': _jaJP, }; static const Map _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建议', }; static const Map _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', }; static const Map _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の提案', }; }