Merge pull request #54 from lzw-723/feature/zh

This commit is contained in:
Dionisio Pozo
2025-04-15 00:11:09 +02:00
committed by GitHub
3 changed files with 224 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ let currentLocale =
'en';
// Supported locales
const supportedLocales = ['en', 'es'];
const supportedLocales = ['en', 'es', 'zh'];
// Fallback to English if locale is not supported
if (!supportedLocales.includes(currentLocale)) {
@@ -267,4 +267,4 @@ window.i18n = {
getSupportedLocales,
translatePage,
isLoaded: () => translationsLoaded
};
};

View File

@@ -5,7 +5,8 @@
// Language codes and names
const languages = [
{ code: 'en', name: 'English' },
{ code: 'es', name: 'Español' }
{ code: 'es', name: 'Español' },
{ code: 'zh', name: '中文' }
];
/**
@@ -63,4 +64,4 @@ function createLanguageSelector(containerId = 'language-selector') {
document.addEventListener('DOMContentLoaded', () => {
// Create language selector
createLanguageSelector();
});
});

219
static/locales/zh.json Normal file
View File

@@ -0,0 +1,219 @@
{
"app": {
"title": "OxiCloud",
"description": "极简云存储系统"
},
"nav": {
"files": "文件",
"shared": "共享",
"recent": "最近",
"favorites": "收藏",
"trash": "回收站"
},
"actions": {
"search": "搜索文件...",
"new_folder": "新建文件夹",
"upload": "上传",
"rename": "重命名",
"move": "移动到...",
"move_to": "移动到",
"delete": "删除",
"download": "下载",
"view": "查看",
"cancel": "取消",
"confirm": "确认",
"share": "共享",
"copy": "复制",
"notify": "通知",
"send": "发送",
"clear_recent": "清除最近"
},
"share": {
"dialogTitle": "共享链接",
"linkLabel": "共享链接:",
"copyLink": "复制",
"permissions": "权限:",
"permissionRead": "读取",
"permissionWrite": "写入",
"permissionReshare": "再共享",
"password": "密码保护:",
"generatePassword": "生成",
"expiration": "过期日期:",
"update": "更新共享",
"remove": "移除共享",
"notifyTitle": "发送通知",
"notifyEmailLabel": "电子邮件地址:",
"notifyMessageLabel": "消息(可选):",
"notifySend": "发送通知",
"shareWithOthers": "与他人共享",
"sharePublicly": "公开共享",
"shareSettings": "共享设置",
"shareCopied": "链接已复制到剪贴板",
"shareCreated": "共享链接创建成功",
"shareUpdated": "共享设置更新成功",
"shareRemoved": "共享已移除"
},
"share_dialogTitle": "共享链接",
"share_linkLabel": "共享链接:",
"share_copyLink": "复制",
"share_permissions": "权限:",
"share_permissionRead": "读取",
"share_permissionWrite": "写入",
"share_permissionReshare": "再共享",
"share_password": "密码保护:",
"share_generatePassword": "生成",
"share_expiration": "过期日期:",
"share_update": "更新共享",
"share_remove": "移除共享",
"share_notifyTitle": "发送通知",
"share_notifyEmailLabel": "电子邮件地址:",
"share_notifyMessageLabel": "消息(可选):",
"share_notifySend": "发送通知",
"shared": {
"backToFiles": "返回文件",
"pageTitle": "共享资源",
"pageDescription": "管理你的共享文件和文件夹",
"filterType": "类型:",
"filterAll": "全部",
"filterFiles": "文件",
"filterFolders": "文件夹",
"sortBy": "排序依据:",
"sortByName": "名称",
"sortByDate": "共享日期",
"sortByExpiration": "过期日期",
"search": "搜索",
"colName": "名称",
"colType": "类型",
"colDateShared": "共享日期",
"colExpiration": "过期日期",
"colPermissions": "权限",
"colPassword": "密码",
"colActions": "操作",
"emptyStateTitle": "尚未有共享资源",
"emptyStateDesc": "当你共享文件或文件夹时,它们会出现在这里",
"goToFiles": "前往文件",
"typeFile": "文件",
"typeFolder": "文件夹",
"noExpiration": "无过期",
"hasPassword": "有",
"noPassword": "无",
"editShare": "编辑共享",
"notifyShare": "通知某人",
"copyLink": "复制链接",
"removeShare": "移除共享",
"linkCopied": "链接已复制到剪贴板!",
"linkCopyFailed": "复制链接失败",
"itemUpdated": "共享设置更新成功",
"itemRemoved": "共享已移除成功",
"invalidEmail": "请输入有效的电子邮件地址",
"notificationSent": "通知已成功发送",
"notificationFailed": "发送通知失败"
},
"files": {
"name": "名称",
"type": "类型",
"size": "大小",
"modified": "修改日期",
"no_files": "此文件夹中没有文件",
"view_grid": "网格视图",
"view_list": "列表视图",
"file_types": {
"document": "文档",
"image": "图片",
"video": "视频",
"audio": "音频",
"pdf": "PDF",
"text": "文本",
"folder": "文件夹"
}
},
"dialogs": {
"rename_folder": "重命名文件夹",
"new_name": "新名称",
"move_file": "移动文件",
"select_destination": "选择目标文件夹",
"root": "根目录",
"delete_confirmation": "你确定要删除",
"and_contents": "及其所有内容",
"no_undo": "此操作无法撤销",
"share_file": "共享文件",
"existing_shares": "现有共享",
"share_options": "共享选项",
"password": "密码",
"expiration": "过期日期",
"permissions": "权限",
"generated_link": "生成的链接",
"notify": "发送通知",
"recipient": "收件人",
"message": "消息"
},
"dropzone": {
"drag_files": "将文件拖到这里,或点击选择",
"drop_files": "释放文件以上传"
},
"permissions": {
"read": "读取",
"write": "写入",
"reshare": "再共享"
},
"errors": {
"file_not_found": "文件未找到",
"folder_not_found": "文件夹未找到",
"delete_error": "删除时出错",
"upload_error": "上传文件时出错",
"rename_error": "重命名时出错",
"move_error": "移动时出错",
"empty_name": "名称不能为空",
"name_exists": "已存在同名文件或文件夹",
"generic_error": "发生错误"
},
"breadcrumb": {
"home": "主页"
},
"trash": {
"empty_trash": "清空回收站",
"empty_state": "回收站为空",
"original_location": "原始位置",
"deleted_date": "删除日期",
"actions": "操作",
"restore": "恢复",
"delete_permanently": "永久删除",
"empty_confirm": "你确定要清空回收站吗?这将永久删除所有项目。"
},
"auth": {
"login_title": "登录",
"username": "用户名",
"username_placeholder": "输入你的用户名",
"password": "密码",
"password_placeholder": "输入你的密码",
"login_button": "登录",
"no_account": "没有账号?",
"register": "注册",
"admin_setup": "首次使用?",
"setup": "设置管理员",
"register_title": "创建账号",
"email": "电子邮件",
"email_placeholder": "输入你的电子邮件",
"confirm_password": "确认密码",
"confirm_password_placeholder": "确认你的密码",
"register_button": "创建账号",
"have_account": "已有账号?",
"login": "登录",
"setup_title": "初始设置",
"setup_step1": "管理员",
"setup_step2": "系统",
"setup_step3": "完成",
"admin_username": "管理员用户名",
"admin_email": "管理员电子邮件",
"admin_password": "管理员密码",
"create_admin": "创建管理员",
"back_to_login": "已设置完成?"
},
"viewer": {
"unsupported_file": "无法预览此文件类型。",
"download_file": "下载文件",
"zoom_in": "放大",
"zoom_out": "缩小",
"zoom_reset": "重置缩放"
}
}