365 lines
15 KiB
TypeScript
365 lines
15 KiB
TypeScript
type Language = 'en' | 'ja' | 'zh-CN' | 'zh-TW';
|
||
|
||
const translations: Record<Language, Record<string, string>> = {
|
||
'en': {
|
||
'app.name': 'BitSage',
|
||
'menu.home': 'Home',
|
||
'group.learning': 'Learning & Research',
|
||
'group.creation': 'Creative Studio',
|
||
'module.tutor': 'CS Tutor',
|
||
'module.thinker': 'Deep Thinker',
|
||
'module.research': 'Research',
|
||
'module.vision': 'Vision Lab',
|
||
'module.studio': 'Video Studio',
|
||
'module.audio': 'Audio Lab',
|
||
|
||
'desc.tutor': 'Expert Q&A and coding help',
|
||
'desc.thinker': 'Deep reasoning for complex problems',
|
||
'desc.research': 'Web-grounded academic research',
|
||
'desc.vision': 'Image analysis and generation',
|
||
'desc.studio': 'AI video generation studio',
|
||
'desc.audio': 'Speech-to-text and Text-to-speech',
|
||
|
||
'welcome.title': 'Welcome to BitSage',
|
||
'welcome.subtitle': 'Your AI companion for Computer Science & Technology.',
|
||
'welcome.setup': 'Please enter your Gemini API Key to get started.',
|
||
|
||
'settings.title': 'Settings',
|
||
'settings.apiKey': 'API Key',
|
||
'settings.language': 'Language',
|
||
'settings.theme': 'Theme',
|
||
'settings.data': 'Data Management',
|
||
'settings.export': 'Export Data',
|
||
'settings.import': 'Import Data',
|
||
'settings.clear_data': 'Clear All Data',
|
||
'settings.danger_zone': 'Danger Zone',
|
||
'settings.key_notice': 'Stored locally in your browser.',
|
||
|
||
'action.send': 'Send',
|
||
'action.upload': 'Upload',
|
||
'action.record': 'Record',
|
||
'action.stop': 'Stop',
|
||
'action.generate': 'Generate',
|
||
'action.new_chat': 'New Chat',
|
||
'action.install': 'Install App',
|
||
|
||
'history.title': 'History',
|
||
'history.empty': 'No history for this module.',
|
||
|
||
'prompt.placeholder': 'Ask me anything about CS...',
|
||
'status.thinking': 'Thinking deeply...',
|
||
'status.generating': 'Generating...',
|
||
'status.recording': 'Recording...',
|
||
|
||
'msg.sources': 'Sources:',
|
||
'msg.thinking': 'Thinking...',
|
||
'disclaimer': 'Gemini can make mistakes. Check important info.',
|
||
|
||
'error.no_key': 'Please set your API Key in settings.',
|
||
'confirm.delete': 'Are you sure you want to delete this chat?',
|
||
'confirm.clear_data': 'WARNING: This will delete ALL your chat history and settings. This action cannot be undone. Are you sure?',
|
||
'alert.import_success': 'Import successful!',
|
||
'alert.invalid_file': 'Invalid file format',
|
||
|
||
'opt.landscape': 'Landscape (16:9)',
|
||
'opt.portrait': 'Portrait (9:16)',
|
||
'opt.square': 'Square (1:1)',
|
||
'opt.wide': 'Wide (16:9)',
|
||
|
||
'veo.prompt': 'Describe the video you want to generate...',
|
||
'img.prompt': 'Describe the image you want to generate...',
|
||
'audio.prompt': 'Enter text to generate speech...',
|
||
'btn.start': 'Get Started',
|
||
|
||
// New Creative Guide Strings
|
||
'guide.vision.title': 'Vision Lab',
|
||
'guide.vision.desc': 'Generate high-quality images from text or analyze uploaded images for code and diagrams.',
|
||
'guide.vision.tip1': 'Describe the scene, style, and lighting in detail.',
|
||
'guide.vision.tip2': 'Upload a UML diagram to get a code implementation.',
|
||
|
||
'guide.studio.title': 'Video Studio',
|
||
'guide.studio.desc': 'Create short, high-quality videos using the Veo model. Perfect for demos or visual concepts.',
|
||
'guide.studio.tip1': 'Specify movement and camera angles (e.g., "Drone shot of...").',
|
||
'guide.studio.tip2': 'Video generation takes a few minutes. Please be patient.',
|
||
|
||
'guide.audio.title': 'Audio Lab',
|
||
'guide.audio.desc': 'Convert text to natural-sounding speech or transcribe recordings.',
|
||
'guide.audio.tip1': 'Enter text to generate speech (TTS).',
|
||
'guide.audio.tip2': 'Future update: Upload audio for transcription.',
|
||
|
||
'ui.workbench': 'Workbench',
|
||
'ui.gallery': 'Results',
|
||
'ui.config': 'Configuration',
|
||
},
|
||
'zh-CN': {
|
||
'app.name': '比特智者',
|
||
'menu.home': '首页',
|
||
'group.learning': '学习与研究',
|
||
'group.creation': '创意工作室',
|
||
'module.tutor': 'CS 导师',
|
||
'module.thinker': '深度思考',
|
||
'module.research': '学术搜索',
|
||
'module.vision': '视觉实验室',
|
||
'module.studio': '视频工作室',
|
||
'module.audio': '音频实验室',
|
||
|
||
'desc.tutor': '专家级问答与代码辅助',
|
||
'desc.thinker': '针对复杂问题的深度推理',
|
||
'desc.research': '基于网络的学术研究',
|
||
'desc.vision': '图像分析与生成',
|
||
'desc.studio': 'AI 视频生成工作室',
|
||
'desc.audio': '语音转文字与文字转语音',
|
||
|
||
'welcome.title': '欢迎使用比特智者',
|
||
'welcome.subtitle': '您的计算机科学与技术学习 AI 助手。',
|
||
'welcome.setup': '请输入您的 Gemini API Key 以开始使用。',
|
||
|
||
'settings.title': '设置',
|
||
'settings.apiKey': 'API 密钥',
|
||
'settings.language': '语言',
|
||
'settings.theme': '主题',
|
||
'settings.data': '数据管理',
|
||
'settings.export': '导出数据',
|
||
'settings.import': '导入数据',
|
||
'settings.clear_data': '清除所有数据',
|
||
'settings.danger_zone': '危险区域',
|
||
'settings.key_notice': '仅保存在您的浏览器本地。',
|
||
|
||
'action.send': '发送',
|
||
'action.upload': '上传',
|
||
'action.record': '录音',
|
||
'action.stop': '停止',
|
||
'action.generate': '生成',
|
||
'action.new_chat': '新会话',
|
||
'action.install': '安装应用',
|
||
|
||
'history.title': '历史记录',
|
||
'history.empty': '暂无该模块的历史记录',
|
||
|
||
'prompt.placeholder': '问我任何关于计算机科学的问题...',
|
||
'status.thinking': '深度思考中...',
|
||
'status.generating': '生成中...',
|
||
'status.recording': '录音中...',
|
||
|
||
'msg.sources': '参考来源:',
|
||
'msg.thinking': '思考中...',
|
||
'disclaimer': 'Gemini 可能会犯错,请核实重要信息。',
|
||
|
||
'error.no_key': '请在设置中配置您的 API Key。',
|
||
'confirm.delete': '确定要删除此会话吗?',
|
||
'confirm.clear_data': '警告:此操作将删除您所有的聊天记录和设置,且无法撤销。确定要继续吗?',
|
||
'alert.import_success': '导入成功!',
|
||
'alert.invalid_file': '无效的文件格式',
|
||
|
||
'opt.landscape': '横屏 (16:9)',
|
||
'opt.portrait': '竖屏 (9:16)',
|
||
'opt.square': '方形 (1:1)',
|
||
'opt.wide': '宽屏 (16:9)',
|
||
|
||
'veo.prompt': '描述您想生成的视频...',
|
||
'img.prompt': '描述您想生成的图片...',
|
||
'audio.prompt': '请输入文本以生成语音...',
|
||
'btn.start': '开始体验',
|
||
|
||
'guide.vision.title': '视觉实验室',
|
||
'guide.vision.desc': '根据文本描述生成高质量图像,或分析上传的图像(如UML图、代码截图)。',
|
||
'guide.vision.tip1': '详细描述场景、风格和光照效果以获得最佳结果。',
|
||
'guide.vision.tip2': '上传架构图可让 AI 辅助生成代码实现。',
|
||
|
||
'guide.studio.title': '视频工作室',
|
||
'guide.studio.desc': '使用 Veo 模型生成短视频。非常适合演示、概念可视化。',
|
||
'guide.studio.tip1': '指定动作和镜头角度(例如“无人机拍摄...”)。',
|
||
'guide.studio.tip2': '视频生成需要几分钟时间,请耐心等待。',
|
||
|
||
'guide.audio.title': '音频实验室',
|
||
'guide.audio.desc': '将文本转换为自然流畅的语音,或将录音转录为文本。',
|
||
'guide.audio.tip1': '输入文本以生成语音 (TTS)。',
|
||
'guide.audio.tip2': '后续更新:支持上传音频进行转录。',
|
||
|
||
'ui.workbench': '工作台',
|
||
'ui.gallery': '生成结果',
|
||
'ui.config': '参数配置',
|
||
},
|
||
'ja': {
|
||
'app.name': 'BitSage',
|
||
'menu.home': 'ホーム',
|
||
'group.learning': '学習と研究',
|
||
'group.creation': 'クリエイティブスタジオ',
|
||
'module.tutor': 'CS 講師',
|
||
'module.thinker': '深い思考',
|
||
'module.research': '研究',
|
||
'module.vision': 'ビジョンラボ',
|
||
'module.studio': 'ビデオスタジオ',
|
||
'module.audio': 'オーディオラボ',
|
||
|
||
'desc.tutor': '専門的なQ&Aとコーディング支援',
|
||
'desc.thinker': '複雑な問題に対する深い推論',
|
||
'desc.research': 'Webに基づく学術研究',
|
||
'desc.vision': '画像分析と生成',
|
||
'desc.studio': 'AIビデオ生成スタジオ',
|
||
'desc.audio': '音声認識と音声合成',
|
||
|
||
'welcome.title': 'BitSageへようこそ',
|
||
'welcome.subtitle': 'コンピュータサイエンス学習のためのAIパートナー。',
|
||
'welcome.setup': '開始するにはGemini APIキーを入力してください。',
|
||
|
||
'settings.title': '設定',
|
||
'settings.apiKey': 'APIキー',
|
||
'settings.language': '言語',
|
||
'settings.theme': 'テーマ',
|
||
'settings.data': 'データ管理',
|
||
'settings.export': 'エクスポート',
|
||
'settings.import': 'インポート',
|
||
'settings.clear_data': '全データを消去',
|
||
'settings.danger_zone': '危険地帯',
|
||
'settings.key_notice': 'ブラウザにローカル保存されます。',
|
||
|
||
'action.send': '送信',
|
||
'action.upload': 'アップロード',
|
||
'action.record': '録音',
|
||
'action.stop': '停止',
|
||
'action.generate': '生成',
|
||
'action.new_chat': '新しいチャット',
|
||
'action.install': 'アプリをインストール',
|
||
|
||
'history.title': '履歴',
|
||
'history.empty': 'このモジュールの履歴はありません。',
|
||
|
||
'prompt.placeholder': 'CSについて何でも聞いてください...',
|
||
'status.thinking': '深く考えています...',
|
||
'status.generating': '生成中...',
|
||
'status.recording': '録音中...',
|
||
|
||
'msg.sources': '情報源:',
|
||
'msg.thinking': '思考中...',
|
||
'disclaimer': 'Geminiは間違いを犯す可能性があります。',
|
||
|
||
'error.no_key': '設定でAPIキーを設定してください。',
|
||
'confirm.delete': 'このチャットを削除してもよろしいですか?',
|
||
'confirm.clear_data': '警告:これにより、すべてのチャット履歴と設定が削除されます。元に戻すことはできません。よろしいですか?',
|
||
'alert.import_success': 'インポートに成功しました!',
|
||
'alert.invalid_file': '無効なファイル形式です',
|
||
|
||
'opt.landscape': '横向き (16:9)',
|
||
'opt.portrait': '縦向き (9:16)',
|
||
'opt.square': '正方形 (1:1)',
|
||
'opt.wide': 'ワイド (16:9)',
|
||
|
||
'veo.prompt': '生成したい動画を説明してください...',
|
||
'img.prompt': '生成したい画像を説明してください...',
|
||
'audio.prompt': '音声を生成するためのテキストを入力...',
|
||
'btn.start': '始める',
|
||
|
||
'guide.vision.title': 'ビジョンラボ',
|
||
'guide.vision.desc': 'テキストから高品質な画像を生成、または画像の分析。',
|
||
'guide.vision.tip1': '詳細なシーン、スタイル、照明を記述してください。',
|
||
'guide.vision.tip2': '図をアップロードしてコードを生成できます。',
|
||
|
||
'guide.studio.title': 'ビデオスタジオ',
|
||
'guide.studio.desc': 'Veoモデルを使用して短いビデオを生成します。',
|
||
'guide.studio.tip1': '動きとカメラアングルを指定してください。',
|
||
'guide.studio.tip2': '生成には数分かかります。',
|
||
|
||
'guide.audio.title': 'オーディオラボ',
|
||
'guide.audio.desc': 'テキストを自然な音声に変換します。',
|
||
'guide.audio.tip1': 'テキストを入力して音声を生成 (TTS)。',
|
||
'guide.audio.tip2': '将来の更新:文字起こし。',
|
||
|
||
'ui.workbench': 'ワークベンチ',
|
||
'ui.gallery': '生成結果',
|
||
'ui.config': '設定',
|
||
},
|
||
'zh-TW': {
|
||
'app.name': '比特智者',
|
||
'menu.home': '首頁',
|
||
'group.learning': '學習與研究',
|
||
'group.creation': '創意工作室',
|
||
'module.tutor': 'CS 導師',
|
||
'module.thinker': '深度思考',
|
||
'module.research': '學術搜尋',
|
||
'module.vision': '視覺實驗室',
|
||
'module.studio': '影片工作室',
|
||
'module.audio': '音訊實驗室',
|
||
|
||
'desc.tutor': '專家級問答與程式碼輔助',
|
||
'desc.thinker': '針對複雜問題的深度推理',
|
||
'desc.research': '基於網路的學術研究',
|
||
'desc.vision': '圖像分析與生成',
|
||
'desc.studio': 'AI 影片生成工作室',
|
||
'desc.audio': '語音轉文字與文字轉語音',
|
||
|
||
'welcome.title': '歡迎使用比特智者',
|
||
'welcome.subtitle': '您的計算機科學與技術學習 AI 助手。',
|
||
'welcome.setup': '請輸入您的 Gemini API Key 以開始使用。',
|
||
|
||
'settings.title': '設定',
|
||
'settings.apiKey': 'API 金鑰',
|
||
'settings.language': '語言',
|
||
'settings.theme': '主題',
|
||
'settings.data': '資料管理',
|
||
'settings.export': '匯出資料',
|
||
'settings.import': '匯入資料',
|
||
'settings.clear_data': '清除所有資料',
|
||
'settings.danger_zone': '危險區域',
|
||
'settings.key_notice': '僅保存在您的瀏覽器本地。',
|
||
|
||
'action.send': '傳送',
|
||
'action.upload': '上傳',
|
||
'action.record': '錄音',
|
||
'action.stop': '停止',
|
||
'action.generate': '生成',
|
||
'action.new_chat': '新對話',
|
||
'action.install': '安裝應用',
|
||
|
||
'history.title': '歷史記錄',
|
||
'history.empty': '暫無該模組的歷史記錄',
|
||
|
||
'prompt.placeholder': '問我任何關於計算機科學的問題...',
|
||
'status.thinking': '深度思考中...',
|
||
'status.generating': '生成中...',
|
||
'status.recording': '錄音中...',
|
||
|
||
'msg.sources': '參考來源:',
|
||
'msg.thinking': '思考中...',
|
||
'disclaimer': 'Gemini 可能會犯錯,請核實重要資訊。',
|
||
|
||
'error.no_key': '請在設定中配置您的 API Key。',
|
||
'confirm.delete': '確定要刪除此對話嗎?',
|
||
'confirm.clear_data': '警告:此操作將刪除您所有的聊天記錄和設定,且無法復原。確定要繼續嗎?',
|
||
'alert.import_success': '匯入成功!',
|
||
'alert.invalid_file': '無效的檔案格式',
|
||
|
||
'opt.landscape': '橫向 (16:9)',
|
||
'opt.portrait': '直向 (9:16)',
|
||
'opt.square': '方形 (1:1)',
|
||
'opt.wide': '寬螢幕 (16:9)',
|
||
|
||
'veo.prompt': '描述您想生成的影片...',
|
||
'img.prompt': '描述您想生成的圖片...',
|
||
'audio.prompt': '請輸入文字以生成語音...',
|
||
'btn.start': '開始體驗',
|
||
|
||
'guide.vision.title': '視覺實驗室',
|
||
'guide.vision.desc': '根據文字描述生成高品質圖像,或分析上傳的圖像。',
|
||
'guide.vision.tip1': '詳細描述場景、風格和光照效果以獲得最佳結果。',
|
||
'guide.vision.tip2': '上傳架構圖可讓 AI 輔助生成程式碼實作。',
|
||
|
||
'guide.studio.title': '影片工作室',
|
||
'guide.studio.desc': '使用 Veo 模型生成短影片。非常適合演示、概念視覺化。',
|
||
'guide.studio.tip1': '指定動作和鏡頭角度(例如「無人機拍攝...」)。',
|
||
'guide.studio.tip2': '影片生成需要幾分鐘時間,請耐心等待。',
|
||
|
||
'guide.audio.title': '音訊實驗室',
|
||
'guide.audio.desc': '將文字轉換為自然流暢的語音,或將錄音轉錄為文字。',
|
||
'guide.audio.tip1': '輸入文字以生成語音 (TTS)。',
|
||
'guide.audio.tip2': '後續更新:支援上傳音訊進行轉錄。',
|
||
|
||
'ui.workbench': '工作台',
|
||
'ui.gallery': '生成結果',
|
||
'ui.config': '參數配置',
|
||
}
|
||
};
|
||
|
||
export const t = (key: string, lang: Language): string => {
|
||
return translations[lang]?.[key] || translations['en'][key] || key;
|
||
}; |