mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-30 07:39:54 +08:00
特性-市场插件的国际化支持
This commit is contained in:
19
feature/src/languages/i18n.ts
Normal file
19
feature/src/languages/i18n.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import messages from './langs';
|
||||
const { remote } = window.require('electron');
|
||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
||||
|
||||
console.log(messages);
|
||||
console.log(perf);
|
||||
|
||||
// 2. Create i18n instance with options
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: perf.common.lang || 'zh-CN', // set locale
|
||||
fallbackLocale: 'zh-CN', // set fallback locale
|
||||
messages, // set locale messages
|
||||
// If you need to specify other options, you can set other options
|
||||
// ...
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
110
feature/src/languages/langs/en-US.ts
Normal file
110
feature/src/languages/langs/en-US.ts
Normal file
@@ -0,0 +1,110 @@
|
||||
export default {
|
||||
'en-US': {
|
||||
feature: {
|
||||
market: {
|
||||
title: 'Market',
|
||||
search: 'Search Plugins',
|
||||
explore: 'Explore',
|
||||
efficiency: 'Efficiency',
|
||||
searchTool: 'Search Tools',
|
||||
imageTool: 'Image Tools',
|
||||
developTool: 'Develop Tools',
|
||||
systemTool: 'System Tools',
|
||||
finder: {
|
||||
recommended: 'Recommended',
|
||||
lastUpdated: 'Last Updated',
|
||||
},
|
||||
install: 'Install',
|
||||
},
|
||||
installed: {
|
||||
title: 'Installed',
|
||||
tips1: 'There are no plug-ins.',
|
||||
tips2: 'Go to the plugin market and choose the plugin to install!',
|
||||
developer: 'Developer',
|
||||
unknown: 'Unknown',
|
||||
remove: 'Remove',
|
||||
functionKey: 'Function Key',
|
||||
detailInfo: 'Detail Info',
|
||||
addToPanel: 'Click the + sign to pin the keyword to the super panel',
|
||||
removeFromPanel:
|
||||
'Click the - sign to remove the keyword from the super panel',
|
||||
},
|
||||
settings: {
|
||||
title: 'Account And Setting',
|
||||
account: {
|
||||
accountInfo: 'Account Info',
|
||||
tips1: 'rubick',
|
||||
tips2:
|
||||
'After the software preferences are set, please restart the software. Please go to the mini program set avatar and nickname.',
|
||||
themeColor: 'Theme Color',
|
||||
primaryColor: 'Primary Color',
|
||||
errorColor: 'Error Color',
|
||||
warningColor: 'Warning Color',
|
||||
successColor: 'Success Color',
|
||||
infoColor: 'Info Color',
|
||||
personalized: 'Personalized',
|
||||
greeting: 'Search Box Greeting',
|
||||
logo: 'Logo',
|
||||
replace: 'Repalce Logo',
|
||||
reset: 'Reset Default',
|
||||
},
|
||||
basic: {
|
||||
title: 'Basic',
|
||||
shortcutKey: 'Shortcut Key',
|
||||
showOrHiddle: 'Show Or Hiddle',
|
||||
screenCapture: 'Screen Capture',
|
||||
common: 'Common',
|
||||
autoPaste: 'Auto Paste',
|
||||
autoBoot: 'Auto Boot Up',
|
||||
spaceExec: 'Space Execution',
|
||||
on: 'on',
|
||||
off: 'off',
|
||||
theme: 'Theme',
|
||||
darkMode: 'Dark Mode',
|
||||
language: 'Language',
|
||||
changeLang: 'Change Language',
|
||||
cn: 'Simplified Chinese',
|
||||
en: 'English',
|
||||
},
|
||||
global: {
|
||||
title: 'Global Shortcut Key',
|
||||
instructions: 'Instructions and examples',
|
||||
tips: 'Press the shortcut key, automatically search for the corresponding keyword, when the keyword result is exactly matched, and the result is unique, it will point directly to this function.',
|
||||
example: 'Example',
|
||||
example1: 'Shortcut key 「Alt + W」 keyword 「Wechat」',
|
||||
tips1: 'Press 「Alt + W」 to open the local Wechat app directly',
|
||||
example2: 'Shortcut key 「Ctrl + Alt + A」 keyword 「screenshot」',
|
||||
tips2: 'Press 「Ctrl + Alt + A」 to take a screenshot',
|
||||
shortcutKey: 'Shortcut Key',
|
||||
funtionKey: 'Funtion Key',
|
||||
addShortcutKey: 'ADD Global Shortcut Key',
|
||||
addShortcutKeyTips:
|
||||
'Press the function keys (Ctrl, Shift, {optionKeyName}) first, and then press other normal keys. Or press the F1-F12 button.',
|
||||
},
|
||||
superPanel: {
|
||||
title: 'Super Panel',
|
||||
tips: 'Please select the common plug-ins that need to be added to the super panel.',
|
||||
add: 'Add',
|
||||
remove: 'Revome',
|
||||
},
|
||||
intranet: {
|
||||
title: 'Intranet Deployment',
|
||||
tips: "If publishing plug-ins to the public network npm does not meet your company's security requirements, rubick supports private network private sources and private plug-in libraries. If you need private network deployment, you can configure the following rules.",
|
||||
npmMirror: 'npm mirror',
|
||||
dbUrl: 'database url',
|
||||
accessToken: 'access token',
|
||||
placeholder: 'required for private network gitlab warehouse',
|
||||
},
|
||||
},
|
||||
dev: {
|
||||
title: 'Developer',
|
||||
tips: 'The rubick plug-in system relies on npm management. Local debugging needs to first execute npm link in the current directory of the local plug-in.',
|
||||
pluginName: 'Plugin Name',
|
||||
install: 'Install',
|
||||
refreshPlugins: 'Refresh Plugins',
|
||||
installSuccess: '{pluginName} Install Successed!',
|
||||
refreshSuccess: '{pluginName} Refresh Successed!',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
9
feature/src/languages/langs/index.ts
Normal file
9
feature/src/languages/langs/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import en from './en-US';
|
||||
import cn from './zh-CN';
|
||||
|
||||
const langs = {
|
||||
...en,
|
||||
...cn,
|
||||
};
|
||||
|
||||
export default langs;
|
||||
108
feature/src/languages/langs/zh-CN.ts
Normal file
108
feature/src/languages/langs/zh-CN.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
export default {
|
||||
'zh-CN': {
|
||||
feature: {
|
||||
market: {
|
||||
title: '插件市场',
|
||||
search: '搜索插件',
|
||||
explore: '探索',
|
||||
efficiency: '效率',
|
||||
searchTool: '搜索工具',
|
||||
imageTool: '图像',
|
||||
developTool: '开发者',
|
||||
systemTool: '系统',
|
||||
finder: {
|
||||
recommended: '推荐',
|
||||
lastUpdated: '最近更新',
|
||||
},
|
||||
install: '安装',
|
||||
},
|
||||
installed: {
|
||||
title: '已安装',
|
||||
tips1: '暂无任何插件',
|
||||
tips2: '去插件市场选择安装合适的插件吧!',
|
||||
developer: '开发者',
|
||||
unknown: '未知',
|
||||
remove: '移除',
|
||||
functionKey: '功能关键字',
|
||||
detailInfo: '详情介绍',
|
||||
addToPanel: '点击+号,固定关键词到超级面板',
|
||||
removeFromPanel: '点击-号,从超级面板移除关键词',
|
||||
},
|
||||
settings: {
|
||||
title: '账户和设置',
|
||||
account: {
|
||||
accountInfo: '账户信息',
|
||||
tips1: 'rubick 用户',
|
||||
tips2: '软件偏好设置完成后需重启软件,头像和昵称请前往小程序设置',
|
||||
themeColor: '主题色设置',
|
||||
primaryColor: '主色调',
|
||||
errorColor: '错误色',
|
||||
warningColor: '警告色',
|
||||
successColor: '成功色',
|
||||
infoColor: '提醒色',
|
||||
personalized: '用户个性化设置',
|
||||
greeting: '主搜索框欢迎语',
|
||||
logo: '界面 logo',
|
||||
replace: '点我替换',
|
||||
reset: '恢复默认设置',
|
||||
},
|
||||
basic: {
|
||||
title: '基本设置',
|
||||
shortcutKey: '快捷键',
|
||||
showOrHiddle: '显示/隐藏快捷键',
|
||||
screenCapture: '截屏',
|
||||
common: '通用',
|
||||
autoPaste: '输入框自动粘贴',
|
||||
autoBoot: '开机启动',
|
||||
spaceExec: '空格执行',
|
||||
on: '开',
|
||||
off: '关',
|
||||
theme: '主题',
|
||||
darkMode: '暗黑模式',
|
||||
language: '语言',
|
||||
changeLang: '切换语言',
|
||||
cn: '简体中文',
|
||||
en: '英文',
|
||||
},
|
||||
global: {
|
||||
title: '全局快捷键',
|
||||
instructions: '说明及示例',
|
||||
tips: '按下快捷键,自动搜索对应关键字,当关键字结果完全匹配,且结果唯一时,会直接指向该功能。',
|
||||
example: '示例',
|
||||
example1: '快捷键 「 Alt + W」 关键字 「 微信」',
|
||||
tips1: '按下Alt + W 直接打开本地微信应用',
|
||||
example2: '快捷键 「 Ctrl + Alt + A」 关键字 「 截屏」',
|
||||
tips2: '按下 Ctrl + Alt + A 进行截屏',
|
||||
shortcutKey: '快捷键',
|
||||
funtionKey: '功能关键字',
|
||||
addShortcutKey: '新增全局快捷功能',
|
||||
addShortcutKeyTips:
|
||||
'先按功能键(Ctrl、Shift、{optionKeyName}),再按其他普通键。或按 F1-F12 单键。',
|
||||
},
|
||||
superPanel: {
|
||||
title: '超级面板设置',
|
||||
tips: '请选择需要添加到超级面板中的常用插件',
|
||||
add: '添加',
|
||||
remove: '移除',
|
||||
},
|
||||
intranet: {
|
||||
title: '内网部署配置',
|
||||
tips: '把插件发布到公网 npm 如果不符合您的公司安全要求,rubick 支持内网私有源和私有插件库,如果您需要内网部署使用,可以自行配置以下规则。',
|
||||
npmMirror: 'npm 源',
|
||||
dbUrl: 'database url',
|
||||
accessToken: 'access token',
|
||||
placeholder: '内网gitlab仓库必填',
|
||||
},
|
||||
},
|
||||
dev: {
|
||||
title: '开发者',
|
||||
tips: 'rubick 插件系统依托于 npm 管理,本地调试需要先在本地插件当前目录执行 npm link',
|
||||
pluginName: '插件名称',
|
||||
install: '安装',
|
||||
refreshPlugins: '刷新插件',
|
||||
installSuccess: '{pluginName}安装成功!',
|
||||
refreshSuccess: '{pluginName}刷新成功!',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user