From f82d54dacce673306f4d1de5e7e7272120ce8b43 Mon Sep 17 00:00:00 2001 From: MLP Date: Thu, 16 Jul 2026 18:56:40 +0530 Subject: [PATCH 1/2] [ADD]Added Chinese translation. --- app/locales/zh.json | 189 ++++++++++++++++++++++++++++++++++++++++++++ app/ui_locales.py | 2 + 2 files changed, 191 insertions(+) create mode 100644 app/locales/zh.json diff --git a/app/locales/zh.json b/app/locales/zh.json new file mode 100644 index 0000000..a0459d4 --- /dev/null +++ b/app/locales/zh.json @@ -0,0 +1,189 @@ +{ + "_languages": { + "ar": "阿拉伯语", + "bg": "保加利亚语", + "bn": "孟加拉语", + "cs": "捷克语", + "da": "丹麦语", + "de": "德语", + "el": "希腊语", + "en": "英语", + "es": "西班牙语", + "es_MX": "西班牙语(墨西哥)", + "et": "爱沙尼亚语", + "fi": "芬兰语", + "fr": "法语", + "gu": "古吉拉特语", + "hi": "印地语", + "hr": "克罗地亚语", + "hu": "匈牙利语", + "id": "印度尼西亚语", + "it": "意大利语", + "ja": "日语", + "kn": "卡纳达语", + "ko": "韩语", + "lt": "立陶宛语", + "lv": "拉脱维亚语", + "ml": "马拉雅拉姆语", + "mr": "马拉地语", + "nl": "荷兰语", + "nl_BE": "荷兰语(比利时)", + "pl": "波兰语", + "pt": "葡萄牙语", + "ro": "罗马尼亚语", + "ru": "俄语", + "sk": "斯洛伐克语", + "sl": "斯洛文尼亚语", + "sv": "瑞典语", + "ta": "泰米尔语", + "te": "泰卢固语", + "tr": "土耳其语", + "uk": "乌克兰语", + "vi": "越南语", + "zh": "中文" + }, + "_text": { + "AGPL-3.0": "AGPL-3.0", + "Arabic": "阿拉伯语", + "Audio Input Device": "音频输入设备", + "Audio Output Device": "音频输出设备", + "Audio capture ready": "音频采集就绪", + "Bengali": "孟加拉语", + "BizzAppDev Systems Pvt. Ltd.": "BizzAppDev Systems Pvt. Ltd.", + "Bulgarian": "保加利亚语", + "Capturing shared tab context": "正在捕获共享标签页上下文", + "Chinese": "中文", + "Choose the language used for PolyTalk controls and messages.": "选择用于 PolyTalk 控件和消息的语言。", + "Close settings": "关闭设置", + "Connecting to server": "正在连接到服务器", + "Connection issue detected. Please try again.": "检测到连接问题。请重试。", + "Conversation": "对话", + "Conversation with microphone": "使用麦克风对话", + "Croatian": "克罗地亚语", + "Czech": "捷克语", + "Danish": "丹麦语", + "Dutch": "荷兰语", + "Dutch (Belgium)": "荷兰语(比利时)", + "English": "英语", + "Estonian": "爱沙尼亚语", + "Experimental": "实验性", + "Failed to start microphone. Please check permissions.": "麦克风启动失败。请检查权限。", + "Failed to start tab audio capture": "标签页音频采集启动失败", + "Finnish": "芬兰语", + "French": "法语", + "German": "德语", + "Greek": "希腊语", + "Gujarati": "古吉拉特语", + "Hindi": "印地语", + "Hungarian": "匈牙利语", + "Indonesian": "印度尼西亚语", + "Interface Language": "界面语言", + "Italian": "意大利语", + "Japanese": "日语", + "Kannada": "卡纳达语", + "Korean": "韩语", + "Languages swapped!": "语言已交换!", + "Latvian": "拉脱维亚语", + "Listening...": "正在聆听...", + "Lithuanian": "立陶宛语", + "Live Transcript": "实时文字记录", + "Live Translate (Microphone)": "实时翻译(麦克风)", + "Live Translate with microphone": "使用麦克风进行实时翻译", + "Live Translation": "实时翻译", + "Live translation complete!": "实时翻译完成!", + "Live translation stopped.": "实时翻译已停止。", + "Malayalam": "马拉雅拉姆语", + "Marathi": "马拉地语", + "Microphone": "麦克风", + "Microphone access granted! Ready for live translation.": "麦克风访问权限已授予!准备好进行实时翻译。", + "Microphone access needed. Click \"Live Translate\" and allow microphone permission when prompted.": "需要麦克风访问权限。点击\"实时翻译\"并在提示时允许麦克风权限。", + "Microphone permission denied. Click the lock icon in your browser address bar and allow microphone access to use live translation.": "麦克风权限被拒绝。点击浏览器地址栏中的锁形图标,并允许麦克风访问以使用实时翻译。", + "Microphone permission is required to view available devices.": "查看可用设备需要麦克风权限。", + "Microphone ready": "麦克风就绪", + "Microphone unavailable": "麦克风不可用", + "No audio track found. Please select a tab with audio and enable \"Share audio\".": "未找到音轨。请选择带有音频的标签页并启用\"共享音频\"。", + "Not supported on mobile yet": "目前不支持移动设备", + "Opening screen sharing dialog": "正在打开屏幕共享对话框", + "Pause": "暂停", + "Pause live translation": "暂停实时翻译", + "Paused": "已暂停", + "Paused. Audio transmission stopped.": "已暂停。音频传输已停止。", + "Polish": "波兰语", + "PolyTalk Logo": "PolyTalk Logo", + "PolyTalk • Privacy-first Real-time Translation": "PolyTalk • 隐私优先的实时翻译", + "Portuguese": "葡萄牙语", + "Preparing session": "正在准备会话", + "Preparing...": "正在准备...", + "Ready": "就绪", + "Ready to use microphone for live translation": "准备好使用麦克风进行实时翻译", + "Ready. Listening now.": "就绪。正在聆听。", + "Real time Live speech-to-speech translations": "实时语音到语音翻译", + "Recording": "录制中", + "Requesting microphone access": "正在请求麦克风访问权限", + "Requesting microphone access...": "正在请求麦克风访问权限...", + "Resume": "恢复", + "Resume live translation": "恢复实时翻译", + "Resumed. Audio transmission continues.": "已恢复。音频传输继续。", + "Romanian": "罗马尼亚语", + "Russian": "俄语", + "Save & Close": "保存并关闭", + "Select Microphone": "选择麦克风", + "Select the device where you want to hear the translated audio.": "选择您要听取翻译音频的设备。", + "Select the microphone you want to use for speaking.": "选择您要用于说话的麦克风。", + "Server connected": "已连接服务器", + "Settings": "设置", + "Settings saved successfully!": "设置保存成功!", + "Share Tab Audio": "共享标签页音频", + "Shared tab context unavailable": "共享标签页上下文不可用", + "Slovak": "斯洛伐克语", + "Slovenian": "斯洛文尼亚语", + "Source": "源语言", + "Source Language": "源语言", + "Source and target languages must be different.": "源语言和目标语言必须不同。", + "Spanish": "西班牙语", + "Spanish (Mexico)": "西班牙语(墨西哥)", + "Speaker/Headphones": "扬声器/耳机", + "Start speaking. Your speech will appear here in real-time.": "开始说话。您的发言将实时显示在这里。", + "Stop": "停止", + "Stop live translation": "停止实时翻译", + "Swap Languages": "交换语言", + "Swap is disabled during active sessions.": "活跃会话期间禁用交换。", + "Swap is disabled in live and conversation modes.": "实时和对话模式禁用交换。", + "Swap languages": "交换语言", + "Swedish": "瑞典语", + "Tab audio captured": "已捕获标签页音频", + "Tab audio selected": "已选择标签页音频", + "Tab audio sharing is not supported in this browser": "此浏览器不支持标签页音频共享", + "Tab audio sharing is not supported on mobile devices. Please use \"Live Translate (Microphone)\" instead, or switch to a desktop browser.": "移动设备不支持标签页音频共享。请改用\"实时翻译(麦克风)\",或切换到桌面浏览器。", + "Tab audio unavailable": "标签页音频不可用", + "Tab sharing stopped.": "标签页共享已停止。", + "Tamil": "泰米尔语", + "Target Language": "目标语言", + "Telugu": "泰卢固语", + "🔊 Translated Voice Output": "🔊 翻译语音输出", + "Translated Voice Output": "翻译语音输出", + "Translated speech will appear here instantly.": "翻译后的语音将立即显示在这里。", + "Turkish": "土耳其语", + "UI Language": "UI 语言", + "Ukrainian": "乌克兰语", + "User cancelled screen sharing": "用户取消了屏幕共享", + "Vietnamese": "越南语", + "Your browser does not support audio recording. Please use a modern browser like Chrome, Firefox, or Edge.": "您的浏览器不支持音频录制。请使用 Chrome、Firefox 或 Edge 等现代浏览器。", + "Your browser does not support tab audio sharing.": "您的浏览器不支持标签页音频共享。", + "Your browser does not support the audio element.": "您的浏览器不支持音频元素。", + "getUserMedia is not supported in this browser.": "此浏览器不支持 getUserMedia。", + "AI Behavior": "AI 行为", + "Translation Instructions": "翻译指令", + "Translate formally. Keep technical terms in English.": "使用正式语态进行翻译。技术术语保留英文。", + "Optional guidance sent with live, conversation, and tab-audio translation sessions.": "可选指导信息会随实时翻译、对话和标签页音频翻译会话一起发送。" + }, + "app.title": "PolyTalk - 隐私优先的自托管翻译", + "js.error_message": "错误:{error}", + "js.failed_share_tab_audio": "共享标签页音频失败:{error}", + "js.microphone_access_failed": "麦克风访问失败:{name} - {message}", + "js.microphone_changed": "麦克风已更改为:{device}", + "js.microphone_number": "麦克风 {number}", + "js.output_device_changed": "输出设备已更改为:{device}", + "js.speaker_number": "扬声器 {number}", + "settings.ui_language": "UI 语言" +} diff --git a/app/ui_locales.py b/app/ui_locales.py index 0210d81..3f52248 100644 --- a/app/ui_locales.py +++ b/app/ui_locales.py @@ -12,6 +12,7 @@ "fi", "fr", "it", + "zh", "nl", "pl", "pt", @@ -33,4 +34,5 @@ "pt": "Português", "ro": "Română", "sv": "Svenska", + "zh": "中文", } From a4e5a30bbf216e1625b78814a6160c8f592edae5 Mon Sep 17 00:00:00 2001 From: MLP Date: Tue, 21 Jul 2026 14:43:56 +0530 Subject: [PATCH 2/2] [IMP]Reordered the position in Supporte UI locales. --- app/ui_locales.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui_locales.py b/app/ui_locales.py index 3f52248..b0f6b75 100644 --- a/app/ui_locales.py +++ b/app/ui_locales.py @@ -12,12 +12,12 @@ "fi", "fr", "it", - "zh", "nl", "pl", "pt", "ro", "sv", + "zh", } UI_LOCALE_NATIVE_NAMES = {