Add left sidebar translation

This commit is contained in:
月月
2024-09-15 16:10:30 +08:00
parent 1e3f49a3f8
commit 73334862c6
13 changed files with 132 additions and 100 deletions
+3 -15
View File
@@ -35,19 +35,10 @@ async function loadLanguage(lang) {
currentLanguage = lang;
}
// Set the current language
function setLanguage(lang) {
try {
loadLanguage(lang);
} catch (error) {
console.error(`Failed to set language, language code: ${lang}:`, error);
}
}
// Get translation, if no corresponding value, return the key
function setString(key) {
function getString(key) {
if (!translations[currentLanguage]?.[key]) {
console.log(':' + key);
console.log('Not found:' + key);
}
return translations[currentLanguage]?.[key] || key;
}
@@ -63,7 +54,4 @@ function init() {
}
}
export { setString, init, setLanguage };
export { getString, init };
+50 -8
View File
@@ -1,11 +1,53 @@
{
"No media": "无媒体活动",
"Options": "选项",
"Dark Mode": "深色模式",
"Close": "关闭",
"Keybinds": "按键绑定",
"Periodic table": "周期表",
"Cheat sheet": "备忘单",
"notifications": "通知",
"Clear": "清除"
"Clear": "清除",
"Assistant": "助手",
"Powered by Google": "由谷歌提供技术支持",
"Uses gemini-pro.\nNot affiliated, endorsed, or sponsored by Google.\n\nPrivacy: Chat messages aren't linked to your account,\n but will be read by human reviewers to improve the model.": "使用 gemini-pro\n不隶属于、不受谷歌赞助或支持。\n\n隐私:聊天信息不会与你的账户关联。\n但会被人类审阅者阅读,用于改进模型。",
"Precise": "精确",
"Balanced": "平衡",
"Creative": "创意",
"Gemini's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1": "Gemini的temperature值\n 精确 = 0\n 平衡 = 0.5\n 创意 = 1",
"Enhancements": "增强功能",
"Tells Gemini:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points": "告诉 Gemini:\n- 这是一个 Linux 侧边栏助手\n- 简洁明了,使用项目符号",
"Safety": "安全",
"When turned off, tells the API (not the model) \nto not block harmful/explicit content": "当关闭时,告诉API(而不是模型)\n不要屏蔽有害/显露的内容",
"History": "历史",
"Saves chat history\nMessages in previous chats won't show automatically, but they are there": "保存聊天历史\n以前聊天中的消息不会自动显示,但它们仍然存在",
"Key stored in:": "密钥值储存在:",
"To update this key, type": "要更新此密钥,请输入",
"Updated API Key at": "更新了 API 密钥于",
"Currently using": "当前使用",
"Select ChatGPT-compatible API provider": "选择与 ChatGPT 兼容的 API 提供商",
"Provider shown above": "上述显示的提供商",
"Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.": "使用 gpt-3.5-turbo。\n与 OpenAI 无关联,未获得其认可或赞助。\n\n隐私:OpenAI 声明,当您使用他们的 API 时,他们不会使用您的数据。\n我不清楚其他人的情况。",
"The model's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1": "模型的temperature值。\n 精确 = 0\n 平衡 = 0.5\n 创意 = 1",
"An API key is required\nYou can grab one <u>here</u>, then enter it below": "需要 API 密钥\n您可以在<u>这里</u>获取一个,然后在下面输入",
"Tells the model:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points": "告诉模型:\n- 它是一个 Linux 侧边栏助手\n- 保持简洁并使用子弹点",
"Powered by waifu.im + other APIs": "由 waifu.im + 其他 API 提供支持",
"Type tags for a random pic.\nNSFW content will not be returned unless\nyou explicitly request such a tag.\n\nDisclaimer: Not affiliated with the providers\nnor responsible for any of their content.": "输入标签以获取随机图片。\n除非您明确请求,否则不会返回 NSFW 内容。\n\n免责声明:与提供商无关联\n也不对他们的任何内容负责。",
"Tags →": "标签 →",
"Invalid command.": "无效命令。",
"Anime booru": "动漫 Booru",
"Powered by yande.re and konachan": "由 yande.re 和 konachan 提供支持",
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "一个图片 Booru。可能包含 NSFW 内容。\n小心。\n\n免责声明:与提供商无关联\n也不对它的任何内容负责。",
"Lewds": "不雅内容",
"Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}": "启用时显示不雅内容。\n你喜欢这些?添加到 user_options.js 中:\n'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}",
"Save in folder by tags": "按标签保存到文件夹",
"Saves images in folders by their tags": "按标签将图片保存到文件夹中",
"Message Gemini...": "向Gemini发消息...",
"Enter Google AI API Key...": "输入 Google AI API 密钥...",
"Message the model...": "给模型发消息...",
"Enter API Key...": "输入 API 密钥...",
"Enter tags": "输入标签",
"Quick scripts": "快速脚本",
"Change screen resolution": "更改屏幕分辨率",
"Update packages": "更新程序包",
"Trim system generations to 5": "将 system 代数修剪为 5",
"Trim home manager generations to 5": "将 home manager 代数修剪为 5",
"Remove orphan packages": "移除孤儿包",
"Uninstall unused flatpak packages": "卸载未使用的 Flatpak 包",
"<span strikethrough=\"true\">Inaccurate</span> Color picker": "<span strikethrough=\"true\">不准确</span> 颜色选择器",
"Result": "结果",
"illogical-impulse": "illogical-impulse"
}