chore: set Japanese as default locale and remove i18n-cli
- Remove @lobehub/i18n-cli package and .i18nrc.js config - Delete locales/default/ directory (translation source) - Change DEFAULT_LOCALE and fallbackLng to ja-JP - Reorder LOCALES array with Japanese first - Simplify language selector to horizontal solid button style
This commit is contained in:
@@ -1,8 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
entry: ['src/renderer/src/locales/default/*.json'],
|
|
||||||
output: 'src/renderer/src/locales',
|
|
||||||
entryLocale: 'zh-CN',
|
|
||||||
outputLocales: ['en-US', 'ja-JP'],
|
|
||||||
apiKey: process.env.OPENAI_API_KEY || '',
|
|
||||||
apiModel: 'gpt-4o-mini',
|
|
||||||
};
|
|
||||||
1955
package-lock.json
generated
1955
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -17,8 +17,7 @@
|
|||||||
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,json}\"",
|
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,json}\"",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"test:coverage": "vitest run --coverage",
|
"test:coverage": "vitest run --coverage"
|
||||||
"i18n": "lobe-i18n"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/lang-css": "^6.3.0",
|
"@codemirror/lang-css": "^6.3.0",
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||||
"@lobehub/i18n-cli": "^1.26.1",
|
|
||||||
"@types/node": "^22.0.0",
|
"@types/node": "^22.0.0",
|
||||||
"@types/react": "^19.0.0",
|
"@types/react": "^19.0.0",
|
||||||
"@types/react-dom": "^19.0.0",
|
"@types/react-dom": "^19.0.0",
|
||||||
|
|||||||
@@ -29,42 +29,19 @@ const useStyles = createStyles(({ token, css }) => ({
|
|||||||
margin-bottom: ${token.marginMD}px;
|
margin-bottom: ${token.marginMD}px;
|
||||||
color: ${token.colorText};
|
color: ${token.colorText};
|
||||||
`,
|
`,
|
||||||
optionGroup: css`
|
radioGroup: css`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
gap: ${token.marginSM}px;
|
gap: ${token.marginSM}px;
|
||||||
`,
|
|
||||||
radioOption: css`
|
.ant-radio-button-wrapper {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: ${token.paddingSM}px ${token.padding}px;
|
|
||||||
border: 1px solid ${token.colorBorder};
|
|
||||||
border-radius: ${token.borderRadius}px;
|
border-radius: ${token.borderRadius}px;
|
||||||
transition: all 0.2s;
|
border: 1px solid ${token.colorBorder};
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: ${token.colorPrimary};
|
|
||||||
background: ${token.colorPrimaryBg};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.ant-radio-wrapper-checked {
|
.ant-radio-button-wrapper::before {
|
||||||
border-color: ${token.colorPrimary};
|
display: none;
|
||||||
background: ${token.colorPrimaryBg};
|
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
localeLabel: css`
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 2px;
|
|
||||||
`,
|
|
||||||
localeNativeName: css`
|
|
||||||
font-weight: 500;
|
|
||||||
color: ${token.colorText};
|
|
||||||
`,
|
|
||||||
localeName: css`
|
|
||||||
font-size: ${token.fontSizeSM}px;
|
|
||||||
color: ${token.colorTextSecondary};
|
|
||||||
`,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const Settings: React.FC = () => {
|
const Settings: React.FC = () => {
|
||||||
@@ -93,21 +70,14 @@ const Settings: React.FC = () => {
|
|||||||
<Radio.Group
|
<Radio.Group
|
||||||
value={locale}
|
value={locale}
|
||||||
onChange={(e) => handleLocaleChange(e.target.value)}
|
onChange={(e) => handleLocaleChange(e.target.value)}
|
||||||
className={styles.optionGroup}
|
optionType="button"
|
||||||
|
buttonStyle="solid"
|
||||||
|
className={styles.radioGroup}
|
||||||
>
|
>
|
||||||
{LOCALES.map((localeConfig) => (
|
{LOCALES.map((localeConfig) => (
|
||||||
<Radio
|
<Radio.Button key={localeConfig.code} value={localeConfig.code}>
|
||||||
key={localeConfig.code}
|
|
||||||
value={localeConfig.code}
|
|
||||||
className={styles.radioOption}
|
|
||||||
>
|
|
||||||
<div className={styles.localeLabel}>
|
|
||||||
<span className={styles.localeNativeName}>
|
|
||||||
{localeConfig.nativeName}
|
{localeConfig.nativeName}
|
||||||
</span>
|
</Radio.Button>
|
||||||
<span className={styles.localeName}>{localeConfig.name}</span>
|
|
||||||
</div>
|
|
||||||
</Radio>
|
|
||||||
))}
|
))}
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -67,8 +67,7 @@ i18next
|
|||||||
.use(initReactI18next)
|
.use(initReactI18next)
|
||||||
.init({
|
.init({
|
||||||
resources,
|
resources,
|
||||||
fallbackLng: "zh-CN",
|
fallbackLng: "ja-JP",
|
||||||
defaultNS: "common",
|
|
||||||
ns: ["common", "domain", "settings", "errors", "app", "deploy", "file", "version"],
|
ns: ["common", "domain", "settings", "errors", "app", "deploy", "file", "version"],
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false, // React already handles escaping
|
escapeValue: false, // React already handles escaping
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"selectApp": "请选择一个应用",
|
|
||||||
"appNotFound": "未找到应用信息",
|
|
||||||
"noConfig": "暂无配置",
|
|
||||||
"fileUpload": "文件上传",
|
|
||||||
"view": "查看",
|
|
||||||
"downloadAll": "下载全部",
|
|
||||||
"basicInfo": "基本信息",
|
|
||||||
"appId": "应用ID",
|
|
||||||
"appCode": "应用代码",
|
|
||||||
"createdAt": "创建时间",
|
|
||||||
"creator": "创建者",
|
|
||||||
"modifiedAt": "更新时间",
|
|
||||||
"modifier": "更新者",
|
|
||||||
"spaceId": "所属 Space ID",
|
|
||||||
"pcJs": "PC端 JS",
|
|
||||||
"pcCss": "PC端 CSS",
|
|
||||||
"mobileJs": "移动端 JS",
|
|
||||||
"mobileCss": "移动端 CSS",
|
|
||||||
"codeView": "代码查看",
|
|
||||||
"selectFileToView": "请从文件列表中选择要查看的文件",
|
|
||||||
"searchApp": "搜索应用...",
|
|
||||||
"sortByAppId": "应用ID",
|
|
||||||
"sortByName": "名称",
|
|
||||||
"ascending": "升序",
|
|
||||||
"descending": "降序",
|
|
||||||
"reload": "重新加载",
|
|
||||||
"loadApps": "加载应用",
|
|
||||||
"loadingApps": "正在加载应用...",
|
|
||||||
"noApps": "暂无应用数据",
|
|
||||||
"noMatchingApps": "没有匹配的应用",
|
|
||||||
"lastLoaded": "上次加载",
|
|
||||||
"totalApps": "共 {{count}} 个应用",
|
|
||||||
"unpin": "取消置顶",
|
|
||||||
"pinApp": "置顶应用",
|
|
||||||
"selectDomainFirst": "请先选择一个 Domain",
|
|
||||||
"loadAppsFailed": "加载应用失败"
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"appName": "Kintone Manager",
|
|
||||||
"save": "保存",
|
|
||||||
"cancel": "取消",
|
|
||||||
"delete": "删除",
|
|
||||||
"edit": "编辑",
|
|
||||||
"confirm": "确认",
|
|
||||||
"collapseSidebar": "收起侧边栏",
|
|
||||||
"expandSidebar": "展开侧边栏",
|
|
||||||
"add": "添加",
|
|
||||||
"close": "关闭",
|
|
||||||
"search": "搜索",
|
|
||||||
"loading": "加载中...",
|
|
||||||
"success": "成功",
|
|
||||||
"failed": "失败",
|
|
||||||
"warning": "警告",
|
|
||||||
"info": "提示",
|
|
||||||
"yes": "是",
|
|
||||||
"no": "否",
|
|
||||||
"ok": "确定",
|
|
||||||
"back": "返回",
|
|
||||||
"next": "下一步",
|
|
||||||
"previous": "上一步",
|
|
||||||
"submit": "提交",
|
|
||||||
"reset": "重置",
|
|
||||||
"refresh": "刷新",
|
|
||||||
"upload": "上传",
|
|
||||||
"download": "下载",
|
|
||||||
"copy": "复制",
|
|
||||||
"paste": "粘贴",
|
|
||||||
"cut": "剪切",
|
|
||||||
"selectAll": "全选",
|
|
||||||
"deployFiles": "部署文件",
|
|
||||||
"versionHistory": "版本历史",
|
|
||||||
"settings": "设置"
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "部署文件",
|
|
||||||
"selectFiles": "选择要部署的文件",
|
|
||||||
"selectFilesDesc": "请拖拽或选择要部署的 JavaScript 或 CSS 文件",
|
|
||||||
"configurePosition": "配置部署位置",
|
|
||||||
"configurePositionDesc": "为每个文件选择部署位置",
|
|
||||||
"confirmDeployment": "确认部署",
|
|
||||||
"confirmDeploymentDesc": "请确认以下部署信息",
|
|
||||||
"targetDomain": "目标Domain",
|
|
||||||
"targetApp": "目标应用",
|
|
||||||
"deployFiles": "部署文件:",
|
|
||||||
"fileName": "文件名",
|
|
||||||
"type": "类型",
|
|
||||||
"position": "部署位置",
|
|
||||||
"deploying": "正在部署到 Kintone...",
|
|
||||||
"deploySuccess": "部署成功",
|
|
||||||
"deploySuccessDesc": "文件已成功部署到 Kintone",
|
|
||||||
"deployFailed": "部署失败",
|
|
||||||
"deployFailedDesc": "部署过程中发生错误",
|
|
||||||
"done": "完成",
|
|
||||||
"retry": "重试",
|
|
||||||
"confirmDeploy": "确认部署",
|
|
||||||
"selectFile": "选择文件",
|
|
||||||
"configurePos": "配置位置",
|
|
||||||
"pcHeader": "PC端 - Header",
|
|
||||||
"pcBody": "PC端 - Body",
|
|
||||||
"pcFooter": "PC端 - Footer",
|
|
||||||
"mobileHeader": "移动端 - Header",
|
|
||||||
"mobileBody": "移动端 - Body",
|
|
||||||
"mobileFooter": "移动端 - Footer",
|
|
||||||
"pc": "PC端",
|
|
||||||
"mobile": "移动端"
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "域名管理",
|
|
||||||
"addDomain": "添加域名",
|
|
||||||
"editDomain": "编辑域名",
|
|
||||||
"deleteDomain": "删除域名",
|
|
||||||
"domainName": "域名名称",
|
|
||||||
"domainUrl": "域名地址",
|
|
||||||
"domainList": "域名列表",
|
|
||||||
"noDomains": "暂无域名",
|
|
||||||
"addFirstDomain": "添加您的第一个域名",
|
|
||||||
"domainPlaceholder": "例如:example.kintone.com",
|
|
||||||
"namePlaceholder": "例如:我的Kintone",
|
|
||||||
"verifyConnection": "验证连接",
|
|
||||||
"connectionSuccess": "连接成功",
|
|
||||||
"connectionVerified": "已验证",
|
|
||||||
"notVerified": "未验证",
|
|
||||||
"apiToken": "API令牌",
|
|
||||||
"apiTokenPlaceholder": "输入API令牌",
|
|
||||||
"authType": "认证方式",
|
|
||||||
"password": "密码",
|
|
||||||
"apiTokenAuth": "API令牌",
|
|
||||||
"username": "用户名",
|
|
||||||
"usernamePlaceholder": "输入用户名",
|
|
||||||
"passwordPlaceholder": "输入密码",
|
|
||||||
"basicAuth": "Basic认证",
|
|
||||||
"deleteConfirm": "确定要删除这个域名吗?",
|
|
||||||
"deleteWarning": "此操作不可撤销",
|
|
||||||
"lastSync": "最后同步",
|
|
||||||
"syncNow": "立即同步",
|
|
||||||
"syncing": "同步中...",
|
|
||||||
"syncSuccess": "同步成功",
|
|
||||||
"syncFailed": "同步失败",
|
|
||||||
"domainManagement": "Domain 管理",
|
|
||||||
"add": "添加",
|
|
||||||
"noDomainConfig": "暂无 Domain 配置",
|
|
||||||
"addFirstDomainConfig": "添加第一个 Domain",
|
|
||||||
"noDomainSelected": "未选择 Domain",
|
|
||||||
"edit": "编辑",
|
|
||||||
"testConnection": "测试连接",
|
|
||||||
"connected": "已连接",
|
|
||||||
"connectionFailed": "连接失败",
|
|
||||||
"notTested": "未检测",
|
|
||||||
"confirmDelete": "确认删除",
|
|
||||||
"confirmDeleteDesc": "确定要删除此 Domain 配置吗?",
|
|
||||||
"name": "名称",
|
|
||||||
"nameOptional": "可选,留空则使用域名",
|
|
||||||
"kintoneDomain": "Kintone 域名",
|
|
||||||
"enterDomain": "请输入域名",
|
|
||||||
"validDomainRequired": "请输入有效的域名",
|
|
||||||
"enterUsername": "请输入用户名",
|
|
||||||
"usernameLoginHint": "登录 Kintone 的用户名",
|
|
||||||
"enterPassword": "请输入密码",
|
|
||||||
"keepPasswordHint": "留空则保持原密码",
|
|
||||||
"create": "创建",
|
|
||||||
"update": "更新",
|
|
||||||
"domainCreated": "Domain 创建成功",
|
|
||||||
"domainUpdated": "Domain 更新成功",
|
|
||||||
"createFailed": "创建失败",
|
|
||||||
"updateFailed": "更新失败"
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"networkError": "网络错误",
|
|
||||||
"invalidDomain": "无效的域名",
|
|
||||||
"connectionFailed": "连接失败",
|
|
||||||
"saveFailed": "保存失败",
|
|
||||||
"loadFailed": "加载失败",
|
|
||||||
"unknownError": "未知错误",
|
|
||||||
"timeout": "请求超时",
|
|
||||||
"unauthorized": "未授权",
|
|
||||||
"forbidden": "禁止访问",
|
|
||||||
"notFound": "资源不存在",
|
|
||||||
"serverError": "服务器错误",
|
|
||||||
"invalidInput": "输入无效",
|
|
||||||
"requiredField": "此字段为必填",
|
|
||||||
"invalidFormat": "格式无效",
|
|
||||||
"duplicateEntry": "已存在相同记录",
|
|
||||||
"operationCancelled": "操作已取消",
|
|
||||||
"permissionDenied": "权限不足",
|
|
||||||
"fileTooLarge": "文件过大",
|
|
||||||
"unsupportedFormat": "不支持的文件格式",
|
|
||||||
"storageFull": "存储空间不足",
|
|
||||||
"domainAlreadyExists": "该 Domain 已存在"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"loading": "加载中...",
|
|
||||||
"loadFailed": "加载失败",
|
|
||||||
"fileEmpty": "文件内容为空",
|
|
||||||
"copiedToClipboard": "已复制到剪贴板",
|
|
||||||
"downloadSuccess": "下载成功",
|
|
||||||
"clickOrDragToUpload": "点击或拖拽文件到此区域上传",
|
|
||||||
"supportFiles": "支持 .js 和 .css 文件,单个文件最大 {{size}}MB",
|
|
||||||
"selectedFiles": "已选择 {{count}} 个文件",
|
|
||||||
"confirmClear": "确认清空",
|
|
||||||
"confirmClearDesc": "确定要清空所有文件吗?",
|
|
||||||
"clearAll": "清空全部",
|
|
||||||
"onlyJsCss": "只支持 .js 和 .css 文件",
|
|
||||||
"fileSizeLimit": "文件大小不能超过 {{size}}MB"
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "设置",
|
|
||||||
"language": "语言",
|
|
||||||
"selectLanguage": "选择语言",
|
|
||||||
"general": "通用设置",
|
|
||||||
"appearance": "外观",
|
|
||||||
"theme": "主题",
|
|
||||||
"lightTheme": "浅色",
|
|
||||||
"darkTheme": "深色",
|
|
||||||
"systemTheme": "跟随系统",
|
|
||||||
"fontSize": "字体大小",
|
|
||||||
"small": "小",
|
|
||||||
"medium": "中",
|
|
||||||
"large": "大",
|
|
||||||
"autoSave": "自动保存",
|
|
||||||
"autoSaveEnabled": "自动保存已启用",
|
|
||||||
"autoSaveDisabled": "自动保存已禁用",
|
|
||||||
"cache": "缓存",
|
|
||||||
"clearCache": "清除缓存",
|
|
||||||
"cacheCleared": "缓存已清除",
|
|
||||||
"about": "关于",
|
|
||||||
"version": "版本",
|
|
||||||
"checkUpdate": "检查更新",
|
|
||||||
"noUpdates": "已是最新版本",
|
|
||||||
"updateAvailable": "有新版本可用"
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "版本历史",
|
|
||||||
"totalVersions": "{{count}} 个版本",
|
|
||||||
"noVersions": "暂无版本历史",
|
|
||||||
"viewCode": "查看代码",
|
|
||||||
"confirmRollback": "确认回滚",
|
|
||||||
"confirmRollbackDesc": "确定要回滚到此版本吗?",
|
|
||||||
"confirmDelete": "确认删除",
|
|
||||||
"confirmDeleteDesc": "确定要删除此版本吗?",
|
|
||||||
"sourceUpload": "上传",
|
|
||||||
"sourceDownload": "下载",
|
|
||||||
"sourceRollback": "回滚"
|
|
||||||
}
|
|
||||||
@@ -23,22 +23,21 @@ export interface LocaleConfig {
|
|||||||
/**
|
/**
|
||||||
* Default locale code
|
* Default locale code
|
||||||
*/
|
*/
|
||||||
export const DEFAULT_LOCALE: LocaleCode = "zh-CN";
|
export const DEFAULT_LOCALE: LocaleCode = "ja-JP";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Available locale configurations
|
* Available locale configurations
|
||||||
*/
|
*/
|
||||||
export const LOCALES: LocaleConfig[] = [
|
export const LOCALES: LocaleConfig[] = [
|
||||||
{
|
|
||||||
code: "zh-CN",
|
|
||||||
name: "Chinese Simplified",
|
|
||||||
nativeName: "简体中文",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
code: "ja-JP",
|
code: "ja-JP",
|
||||||
name: "Japanese",
|
name: "Japanese",
|
||||||
nativeName: "日本語",
|
nativeName: "日本語",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
code: "zh-CN",
|
||||||
|
name: "Chinese Simplified",
|
||||||
|
nativeName: "简体中文",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
code: "en-US",
|
code: "en-US",
|
||||||
name: "English",
|
name: "English",
|
||||||
|
|||||||
Reference in New Issue
Block a user