Update Chinese translation; add language toggle options in settings (#1869)

This commit is contained in:
end-4
2025-08-26 09:05:51 +07:00
committed by GitHub
5 changed files with 208 additions and 43 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ Singleton {
function getLanguageCode() {
var configLang = "auto"
try {
configLang = ConfigOptions.language.ui
configLang = Config.options.language.ui
} catch (e) {
configLang = "auto"
}
@@ -215,6 +215,7 @@ Singleton {
}
property JsonObject language: JsonObject {
property string ui: "auto" // UI language. "auto" for system locale, or specific language code like "zh_CN", "en_US"
property JsonObject translator: JsonObject {
property string engine: "auto" // Run `trans -list-engines` for available engines. auto should use google
property string targetLanguage: "auto" // Run `trans -list-all` for available languages
@@ -74,7 +74,7 @@ ContentPage {
ConfigRow {
ContentSubsection {
title: "Corner style"
title: Translation.tr("Corner style")
ConfigSelectionArray {
currentValue: Config.options.bar.cornerStyle
@@ -100,7 +100,7 @@ ContentPage {
}
ContentSubsection {
title: "Bar layout"
title: Translation.tr("Bar layout")
ConfigSelectionArray {
currentValue: Config.options.bar.vertical
configOptionName: "bar.vertical"
@@ -269,7 +269,7 @@ ContentPage {
ContentSubsection {
title: Translation.tr("Tray")
ConfigSwitch {
text: Translation.tr('Tint icons')
checked: Config.options.bar.tray.monochromeIcons
@@ -463,6 +463,81 @@ ContentPage {
StyledToolTip {
content: Translation.tr("Such regions could be images or parts of the screen that have some containment.\nMight not always be accurate.\nThis is done with an image processing algorithm run locally and no AI is used.")
}
}
}
}
ContentSection {
title: Translation.tr("Language")
ContentSubsection {
title: Translation.tr("Interface Language")
tooltip: Translation.tr("Select the language for the user interface.\n\"Auto\" will use your system's locale.")
ConfigSelectionArray {
id: languageSelector
currentValue: Config.options.language.ui
configOptionName: "language.ui"
onSelected: newValue => {
Config.options.language.ui = newValue;
reloadNotice.visible = true;
}
options: {
var baseOptions = [
{
displayName: Translation.tr("Auto (System)"),
value: "auto"
}
];
// Generate language options from available languages
// Intl.DisplayNames is not used. Show the language code with underscore replaced by hyphen.
for (var i = 0; i < Translation.availableLanguages.length; i++) {
var lang = Translation.availableLanguages[i];
var displayName = lang.replace('_', '-');
baseOptions.push({
displayName: displayName,
value: lang
});
}
return baseOptions;
}
}
Rectangle {
id: reloadNotice
visible: false
Layout.topMargin: 8
radius: Appearance.rounding.normal
color: Appearance.colors.colPrimaryContainer
Layout.fillWidth: true
implicitWidth: languageRowLayout.implicitWidth + languageRowLayout.anchors.margins * 2
implicitHeight: languageRowLayout.implicitHeight + languageRowLayout.anchors.margins * 2
RowLayout {
id: languageRowLayout
anchors.fill: parent
anchors.margins: 8
spacing: 8
MaterialSymbol {
Layout.fillWidth: false
Layout.alignment: Qt.AlignVCenter
text: "info"
iconSize: Appearance.font.pixelSize.larger
color: Appearance.colors.colOnPrimaryContainer
}
StyledText {
id: noticeText
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
text: Translation.tr("Language setting saved. Please restart Quickshell (Ctrl+Super+R) to apply the new language.")
color: Appearance.colors.colOnPrimaryContainer
wrapMode: Text.WordWrap
}
}
}
}
}
}
+81 -22
View File
@@ -24,7 +24,6 @@
"Bluetooth": "Bluetooth",
"Brightness": "Brightness",
"Cancel": "Cancel",
"Chain of Thought": "Chain of Thought",
"Cheat sheet": "Cheat sheet",
"Choose model": "Choose model",
"Clean stuff | Excellent quality, no NSFW": "Clean stuff | Excellent quality, no NSFW",
@@ -60,7 +59,6 @@
"Logout": "Logout",
"Markdown test": "Markdown test",
"Math result": "Math result",
"Night Light": "Night Light",
"No audio source": "No audio source",
"No media": "No media",
"No notifications": "No notifications",
@@ -108,17 +106,13 @@
"Waifus only | Excellent quality, limited quantity": "Waifus only | Excellent quality, limited quantity",
"Waiting for response...": "Waiting for response...",
"Workspace": "Workspace",
"Set with /mode PROVIDER": "Set with /mode PROVIDER",
"Invalid API provider. Supported: \n-": "Invalid API provider. Supported: \n-",
"Unknown command:": "Unknown command:",
"Type /key to get started with online models\nCtrl+O to expand the sidebar\nCtrl+P to detach sidebar into a window": "Type /key to get started with online models\nCtrl+O to expand the sidebar\nCtrl+P to detach sidebar into a window",
"The current API used. Endpoint:": "The current API used. Endpoint:",
"Provider set to": "Provider set to",
"Invalid model. Supported: \n```": "Invalid model. Supported: \n```",
"That didn't work. Tips:\n- Check your tags and NSFW settings\n- If you don't have a tag in mind, type a page number": "That didn't work. Tips:\n- Check your tags and NSFW settings\n- If you don't have a tag in mind, type a page number",
"Online | Google's model\nGives up-to-date information with search.": "Online | Google's model\nGives up-to-date information with search.",
"Switched to search mode. Continue with the user's request.": "Switched to search mode. Continue with the user's request.",
"Experimental | Online | Google's model\nCan do a little more but doesn't search quickly": "Experimental | Online | Google's model\nCan do a little more but doesn't search quickly",
"Settings": "Settings",
"Save chat": "Save chat",
"Load chat": "Load chat",
@@ -130,7 +124,6 @@
"About": "About",
"Services": "Services",
"Style": "Style",
"Edit config": "Edit config",
"Colors & Wallpaper": "Colors & Wallpaper",
"Light": "Light",
"Dark": "Dark",
@@ -167,7 +160,6 @@
"Policies": "Policies",
"Weeb": "Weeb",
"Closet": "Closet",
"Bar style": "Bar style",
"Show next time": "Show next time",
"Usage": "Usage",
"Plain rectangle": "Plain rectangle",
@@ -179,7 +171,6 @@
"Keybinds": "Keybinds",
"Float": "Float",
"Hug": "Hug",
"Yooooo hi there": "Yooooo hi there",
"illogical-impulse Welcome": "illogical-impulse Welcome",
"Info": "Info",
"Volume limit": "Volume limit",
@@ -218,7 +209,6 @@
"Weather": "Weather",
"Pinned on startup": "Pinned on startup",
"Tip: Hide icons and always show numbers for\nthe classic illogical-impulse experience": "Tip: Hide icons and always show numbers for\nthe classic illogical-impulse experience",
"Appearance": "Appearance",
"Always show numbers": "Always show numbers",
"Buttons": "Buttons",
"Keyboard toggle": "Keyboard toggle",
@@ -266,11 +256,9 @@
"Current API endpoint: %1\nSet it with %2mode PROVIDER": "Current API endpoint: %1\nSet it with %2mode PROVIDER",
"Go to source (%1)": "Go to source (%1)",
"Temperature set to %1": "Temperature set to %1",
"To set an API key, pass it with the command\n\nTo view the key, pass \"get\" with the command<br/>\n\n### For %1:\n\n**Link**: %2\n\n%3": "To set an API key, pass it with the command\n\nTo view the key, pass \"get\" with the command<br/>\n\n### For %1:\n\n**Link**: %2\n\n%3",
"Enter tags, or \"%1\" for commands": "Enter tags, or \"%1\" for commands",
"%1 queries pending": "%1 queries pending",
"API key:\n\n```txt\n%1\n```": "API key:\n\n```txt\n%1\n```",
"Uptime: %1": "Uptime: %1",
"%1 Safe Storage": "%1 Safe Storage",
"%1 does not require an API key": "%1 does not require an API key",
"Temperature: %1": "Temperature: %1",
@@ -316,23 +304,94 @@
"Fully charged": "Fully charged",
"Charging:": "Charging:",
"Discharging:": "Discharging:",
"Uptime:": "Uptime:",
"Upcoming Tasks:": "Upcoming Tasks:",
"No pending tasks": "No pending tasks",
"... and %1 more": "... and %1 more",
"Memory Usage": "Memory Usage",
"Used:": "Used:",
"Free:": "Free:",
"Total:": "Total:",
"Usage:": "Usage:",
"Swap Usage": "Swap Usage",
"Swap:": "Swap:",
"Not configured": "Not configured",
"CPU Usage": "CPU Usage",
"Current:": "Current:",
"Load:": "Load:",
"High": "High",
"Medium": "Medium",
"Low": "Low",
"System Resource": "System Resource"
"To set an API key, pass it with the %4 command\n\nTo view the key, pass \"get\" with the command<br/>\n\n### For %1:\n\n**Link**: %2\n\n%3": "To set an API key, pass it with the %4 command\n\nTo view the key, pass \"get\" with the command<br/>\n\n### For %1:\n\n**Link**: %2\n\n%3",
"Online | %1's model | Delivers fast, responsive and well-formatted answers. Disadvantages: not very eager to do stuff; might make up unknown function calls": "Online | %1's model | Delivers fast, responsive and well-formatted answers. Disadvantages: not very eager to do stuff; might make up unknown function calls",
"Incorrect password": "Incorrect password",
"Usage: %1load CHAT_NAME": "Usage: %1load CHAT_NAME",
"Usage: %1tool TOOL_NAME": "Usage: %1tool TOOL_NAME",
"Feels like %1": "Feels like %1",
"Always": "Always",
"Break": "Break",
"Vertical": "Vertical",
"Set the tool to use for the model.": "Set the tool to use for the model.",
"Lap": "Lap",
"Approve": "Approve",
"No API key\nSet it with /key YOUR_API_KEY": "No API key\nSet it with /key YOUR_API_KEY",
"Sidebars": "Sidebars",
"Up %1": "Up %1",
"Your package manager is running": "Your package manager is running",
"Commands, edit configs, search.\nTakes an extra turn to switch to search mode if that's needed": "Commands, edit configs, search.\nTakes an extra turn to switch to search mode if that's needed",
"Tool set to: %1": "Tool set to: %1",
"Disable tools": "Disable tools",
"Tray": "Tray",
"Temperature\nChange with /temp VALUE": "Temperature\nChange with /temp VALUE",
"Conflicts with the shell's notification implementation": "Conflicts with the shell's notification implementation",
"Pause": "Pause",
"Wallpaper parallax": "Wallpaper parallax",
"Kill conflicting programs?": "Kill conflicting programs?",
"🌿 Long break: %1 minutes": "🌿 Long break: %1 minutes",
"Reject": "Reject",
"Online | Google's model\nNewer model that's slower than its predecessor but should deliver higher quality answers": "Online | Google's model\nNewer model that's slower than its predecessor but should deliver higher quality answers",
"Welcome app": "Welcome app",
"Attach a file. Only works with Gemini.": "Attach a file. Only works with Gemini.",
"Depends on workspace": "Depends on workspace",
"Night Light | Right-click to toggle Auto mode": "Night Light | Right-click to toggle Auto mode",
"Total token count\nInput: %1\nOutput: %2": "Total token count\nInput: %1\nOutput: %2",
"Tint icons": "Tint icons",
"Refreshing (manually triggered)": "Refreshing (manually triggered)",
"Gives the model search capabilities (immediately)": "Gives the model search capabilities (immediately)",
"Performance Profile toggle": "Performance Profile toggle",
"Timer": "Timer",
"**Pricing**: Free tier available with limited rates. See https://docs.github.com/en/billing/concepts/product-billing/github-models\n\n**Instructions**: Generate a GitHub personal access token with Models permission, then set as API key here\n\n**Note**: To use this you will have to set the temperature parameter to 1": "**Pricing**: Free tier available with limited rates. See https://docs.github.com/en/billing/concepts/product-billing/github-models\n\n**Instructions**: Generate a GitHub personal access token with Models permission, then set as API key here\n\n**Note**: To use this you will have to set the temperature parameter to 1",
"Command rejected by user": "Command rejected by user",
"Thought": "Thought",
"Long break": "Long break",
"Hi there! First things first...": "Hi there! First things first...",
"Preferred wallpaper zoom (%)": "Preferred wallpaper zoom (%)",
"Online | Google's model\nA Gemini 2.5 Flash model optimized for cost-efficiency and high throughput.": "Online | Google's model\nA Gemini 2.5 Flash model optimized for cost-efficiency and high throughput.",
"🔴 Focus: %1 minutes": "🔴 Focus: %1 minutes",
"Enjoy! You can reopen the welcome app any time with <tt>Super+Shift+Alt+/</tt>. To open the settings app, hit <tt>Super+I</tt>": "Enjoy! You can reopen the welcome app any time with <tt>Super+Shift+Alt+/</tt>. To open the settings app, hit <tt>Super+I</tt>",
"There might be a download in progress": "There might be a download in progress",
"Start": "Start",
"System uptime:": "System uptime:",
"Keep right sidebar loaded": "Keep right sidebar loaded",
"Current tool: %1\nSet it with %2tool TOOL": "Current tool: %1\nSet it with %2tool TOOL",
"Corner style": "Corner style",
"Reset": "Reset",
"Stopwatch": "Stopwatch",
"Usage: %1save CHAT_NAME": "Usage: %1save CHAT_NAME",
"API key is set\nChange with /key YOUR_API_KEY": "API key is set\nChange with /key YOUR_API_KEY",
"Resume": "Resume",
"Enter password": "Enter password",
"Overall appearance": "Overall appearance",
"Horizontal": "Horizontal",
"Config file": "Config file",
"Pomodoro": "Pomodoro",
"Tint app icons": "Tint app icons",
"Invalid tool. Supported tools:\n- %1": "Invalid tool. Supported tools:\n- %1",
"Invalid arguments. Must provide `command`.": "Invalid arguments. Must provide `command`.",
"When enabled keeps the content of the right sidebar loaded to reduce the delay when opening,\nat the cost of around 15MB of consistent RAM usage. Delay significance depends on your system's performance.\nUsing a custom kernel like linux-cachyos might help": "When enabled keeps the content of the right sidebar loaded to reduce the delay when opening,\nat the cost of around 15MB of consistent RAM usage. Delay significance depends on your system's performance.\nUsing a custom kernel like linux-cachyos might help",
"Depends on sidebars": "Depends on sidebars",
"To Do:": "To Do:",
"**Instructions**: Log into Mistral account, go to Keys on the sidebar, click Create new key": "**Instructions**: Log into Mistral account, go to Keys on the sidebar, click Create new key",
"Online | Google's model\nFast, can perform searches for up-to-date information": "Online | Google's model\nFast, can perform searches for up-to-date information",
"Place at the bottom/right": "Place at the bottom/right",
"Bar layout": "Bar layout",
"Focus": "Focus",
"Conflicts with the shell's system tray implementation": "Conflicts with the shell's system tray implementation",
"Shell conflicts killer": "Shell conflicts killer",
"☕ Break: %1 minutes": "☕ Break: %1 minutes",
"Open the shell config file.\nIf the button doesn't work or doesn't open in your favorite editor,\nyou can manually open ~/.config/illogical-impulse/config.json": "Open the shell config file.\nIf the button doesn't work or doesn't open in your favorite editor,\nyou can manually open ~/.config/illogical-impulse/config.json",
"Online | Google's model\nGoogle's state-of-the-art multipurpose model that excels at coding and complex reasoning tasks.": "Online | Google's model\nGoogle's state-of-the-art multipurpose model that excels at coding and complex reasoning tasks.",
"EasyEffects | Right-click to configure": "EasyEffects | Right-click to configure",
"Automatically hide": "Automatically hide"
}
+46 -16
View File
@@ -140,7 +140,6 @@
"About": "关于",
"Services": "服务",
"Style": "样式",
"Edit config": "编辑配置",
"Colors & Wallpaper": "颜色和壁纸",
"Light": "浅色",
"Dark": "深色",
@@ -177,7 +176,6 @@
"Policies": "策略",
"Weeb": "二次元",
"Closet": "隐藏",
"Bar style": "条栏样式",
"Show next time": "下次显示",
"Usage": "用法",
"Plain rectangle": "纯矩形",
@@ -189,7 +187,6 @@
"Keybinds": "快捷键",
"Float": "浮动",
"Hug": "贴合",
"Yooooo hi there": "哟嗬,您好呀",
"illogical-impulse Welcome": "illogical-impulse 欢迎页",
"Info": "信息",
"Volume limit": "音量限制",
@@ -307,25 +304,15 @@
"Fully charged": "已充满电",
"Charging:": "充电功率:",
"Discharging:": "放电功率:",
"Uptime:": "运行时间:",
"Upcoming Tasks:": "待办任务:",
"No pending tasks": "没有待办任务",
"... and %1 more": "... 还有 %1 个",
"Memory Usage": "内存使用情况",
"Used:": "已用:",
"Free:": "可用:",
"Total:": "总计:",
"Usage:": "占比:",
"Swap Usage": "交换区使用情况",
"Swap:": "交换区:",
"Not configured": "未配置",
"CPU Usage": "CPU 使用情况",
"Current:": "当前占比:",
"Load:": "负载:",
"High": "高",
"Medium": "中",
"Low": "低",
"System Resource": "系统资源",
"Tint icons": "图标着色",
"Performance Profile toggle": "性能配置文件切换",
"**Instructions**: Log into Mistral account, go to Keys on the sidebar, click Create new key": "**说明**:登录 Mistral 账户,在侧边栏中选择 Keys,点击创建新密钥",
@@ -350,7 +337,6 @@
"Tool set to: %1": "工具设置为:%1",
"Wallpaper parallax": "壁纸视差",
"Online | Google's model\nGoogle's state-of-the-art multipurpose model that excels at coding and complex reasoning tasks.": "在线 | Google 模型\nGoogle 最先进的多用途模型,在编程和复杂推理任务方面表现卓越。",
"When enabled keeps the content of the right sidebar loaded to reduce the delay when opening,\nat the cost of around 15MB of consistent RAM usage. Delay significance depends on your system's performance.\nUsing a different kernel might help with this delay": "启用时会保持右侧边栏内容加载以减少打开延迟,\n代价是持续使用约 15MB 内存。延迟程度取决于您的系统性能。\n使用不同的内核可能有助于减少延迟",
"Tint app icons": "应用图标着色",
"Preferred wallpaper zoom (%)": "首选壁纸缩放比例 (%)",
"To set an API key, pass it with the %4 command\n\nTo view the key, pass \"get\" with the command<br/>\n\n### For %1:\n\n**Link**: %2\n\n%3": "要设置 API 密钥,请使用 %4 命令传递\n\n要查看密钥,请在命令中传递 \"get\"<br/>\n\n### 对于 %1\n\n**链接**%2\n\n%3",
@@ -368,5 +354,49 @@
"Command rejected by user": "用户拒绝了命令",
"Invalid tool. Supported tools:\n- %1": "无效工具。支持的工具:\n- %1",
"Keep right sidebar loaded": "保持右侧边栏加载",
"Reject": "拒绝"
}
"Reject": "拒绝",
"Enter password": "输入密码",
"Automatically hide": "自动隐藏",
"**Pricing**: Free tier available with limited rates. See https://docs.github.com/en/billing/concepts/product-billing/github-models\n\n**Instructions**: Generate a GitHub personal access token with Models permission, then set as API key here\n\n**Note**: To use this you will have to set the temperature parameter to 1": "**定价**:提供免费层,速率有限。详情见 https://docs.github.com/en/billing/concepts/product-billing/github-models\n\n**说明**:生成一个具有 Models 权限的 GitHub 个人访问令牌,并在此处将其设置为 API 密钥\n\n**注意**:使用此提供商时需要将温度参数设置为 1",
"Conflicts with the shell's system tray implementation": "与 Shell 的系统托盘实现冲突",
"Horizontal": "水平",
"Enjoy! You can reopen the welcome app any time with <tt>Super+Shift+Alt+/</tt>. To open the settings app, hit <tt>Super+I</tt>": "祝您愉快!随时可以按 <tt>Super+Shift+Alt+/</tt> 重新打开欢迎应用。要打开设置应用,请按 <tt>Super+I</tt>",
"Reset": "重置",
"☕ Break: %1 minutes": "☕ 休息:%1 分钟",
"Pomodoro": "番茄钟",
"Long break": "长休息",
"Resume": "继续",
"Start": "开始",
"Hi there! First things first...": "嗨!先做些重要的事情...",
"Refreshing (manually triggered)": "刷新中(手动触发)",
"Kill conflicting programs?": "结束冲突程序?",
"Place at the bottom/right": "放置在底部/右侧",
"When enabled keeps the content of the right sidebar loaded to reduce the delay when opening,\nat the cost of around 15MB of consistent RAM usage. Delay significance depends on your system's performance.\nUsing a custom kernel like linux-cachyos might help": "启用后会保持右侧边栏内容常驻,以减少打开时的延迟,代价是大约 15MB 的持续内存使用。延迟的影响程度取决于系统性能。使用像 linux-cachyos 这样的自定义内核可能会有所帮助",
"Config file": "配置文件",
"Stopwatch": "秒表",
"Break": "休息",
"Shell conflicts killer": "终止冲突程序",
"Vertical": "垂直",
"🔴 Focus: %1 minutes": "🔴 专注:%1 分钟",
"System uptime:": "系统运行时间:",
"Focus": "专注",
"Open the shell config file.\nIf the button doesn't work or doesn't open in your favorite editor,\nyou can manually open ~/.config/illogical-impulse/config.json": "打开 Shell 配置文件。\n如果按钮无法工作或没有在您喜欢的编辑器中打开,\n可以手动打开 ~/.config/illogical-impulse/config.json",
"Attach a file. Only works with Gemini.": "附加文件。仅适用于 Gemini。",
"🌿 Long break: %1 minutes": "🌿 长休息:%1 分钟",
"Always": "始终",
"To Do:": "待办:",
"Incorrect password": "密码错误",
"Timer": "计时器",
"Conflicts with the shell's notification implementation": "与 Shell 的通知实现冲突",
"Pause": "暂停",
"Feels like %1": "体感温度:%1",
"Lap": "计时",
"Welcome app": "欢迎应用",
"Corner style": "角落样式",
"Bar layout": "条栏布局",
"Language": "语言",
"Select the language for the user interface.\n\"Auto\" will use your system's locale.": "选择用户界面的语言。\n\"自动\" 将使用系统语言环境。",
"Language setting saved. Please restart Quickshell (Ctrl+Super+R) to apply the new language.": "语言设置已保存。请重启 Quickshell (Ctrl+Super+R) 以应用新语言。",
"Auto (System)": "自动(系统)",
"Interface Language": "界面语言"
}