Skip to content

Commit 363bb3d

Browse files
authored
Merge pull request #54 from lzw-723/feature/zh
2 parents d82a917 + e9c0426 commit 363bb3d

File tree

3 files changed

+224
-4
lines changed

3 files changed

+224
-4
lines changed

static/js/i18n.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let currentLocale =
1212
'en';
1313

1414
// Supported locales
15-
const supportedLocales = ['en', 'es'];
15+
const supportedLocales = ['en', 'es', 'zh'];
1616

1717
// Fallback to English if locale is not supported
1818
if (!supportedLocales.includes(currentLocale)) {
@@ -267,4 +267,4 @@ window.i18n = {
267267
getSupportedLocales,
268268
translatePage,
269269
isLoaded: () => translationsLoaded
270-
};
270+
};

static/js/languageSelector.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// Language codes and names
66
const languages = [
77
{ code: 'en', name: 'English' },
8-
{ code: 'es', name: 'Español' }
8+
{ code: 'es', name: 'Español' },
9+
{ code: 'zh', name: '中文' }
910
];
1011

1112
/**
@@ -63,4 +64,4 @@ function createLanguageSelector(containerId = 'language-selector') {
6364
document.addEventListener('DOMContentLoaded', () => {
6465
// Create language selector
6566
createLanguageSelector();
66-
});
67+
});

static/locales/zh.json

+219
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
{
2+
"app": {
3+
"title": "OxiCloud",
4+
"description": "极简云存储系统"
5+
},
6+
"nav": {
7+
"files": "文件",
8+
"shared": "共享",
9+
"recent": "最近",
10+
"favorites": "收藏",
11+
"trash": "回收站"
12+
},
13+
"actions": {
14+
"search": "搜索文件...",
15+
"new_folder": "新建文件夹",
16+
"upload": "上传",
17+
"rename": "重命名",
18+
"move": "移动到...",
19+
"move_to": "移动到",
20+
"delete": "删除",
21+
"download": "下载",
22+
"view": "查看",
23+
"cancel": "取消",
24+
"confirm": "确认",
25+
"share": "共享",
26+
"copy": "复制",
27+
"notify": "通知",
28+
"send": "发送",
29+
"clear_recent": "清除最近"
30+
},
31+
"share": {
32+
"dialogTitle": "共享链接",
33+
"linkLabel": "共享链接:",
34+
"copyLink": "复制",
35+
"permissions": "权限:",
36+
"permissionRead": "读取",
37+
"permissionWrite": "写入",
38+
"permissionReshare": "再共享",
39+
"password": "密码保护:",
40+
"generatePassword": "生成",
41+
"expiration": "过期日期:",
42+
"update": "更新共享",
43+
"remove": "移除共享",
44+
"notifyTitle": "发送通知",
45+
"notifyEmailLabel": "电子邮件地址:",
46+
"notifyMessageLabel": "消息(可选):",
47+
"notifySend": "发送通知",
48+
"shareWithOthers": "与他人共享",
49+
"sharePublicly": "公开共享",
50+
"shareSettings": "共享设置",
51+
"shareCopied": "链接已复制到剪贴板",
52+
"shareCreated": "共享链接创建成功",
53+
"shareUpdated": "共享设置更新成功",
54+
"shareRemoved": "共享已移除"
55+
},
56+
"share_dialogTitle": "共享链接",
57+
"share_linkLabel": "共享链接:",
58+
"share_copyLink": "复制",
59+
"share_permissions": "权限:",
60+
"share_permissionRead": "读取",
61+
"share_permissionWrite": "写入",
62+
"share_permissionReshare": "再共享",
63+
"share_password": "密码保护:",
64+
"share_generatePassword": "生成",
65+
"share_expiration": "过期日期:",
66+
"share_update": "更新共享",
67+
"share_remove": "移除共享",
68+
"share_notifyTitle": "发送通知",
69+
"share_notifyEmailLabel": "电子邮件地址:",
70+
"share_notifyMessageLabel": "消息(可选):",
71+
"share_notifySend": "发送通知",
72+
"shared": {
73+
"backToFiles": "返回文件",
74+
"pageTitle": "共享资源",
75+
"pageDescription": "管理你的共享文件和文件夹",
76+
"filterType": "类型:",
77+
"filterAll": "全部",
78+
"filterFiles": "文件",
79+
"filterFolders": "文件夹",
80+
"sortBy": "排序依据:",
81+
"sortByName": "名称",
82+
"sortByDate": "共享日期",
83+
"sortByExpiration": "过期日期",
84+
"search": "搜索",
85+
"colName": "名称",
86+
"colType": "类型",
87+
"colDateShared": "共享日期",
88+
"colExpiration": "过期日期",
89+
"colPermissions": "权限",
90+
"colPassword": "密码",
91+
"colActions": "操作",
92+
"emptyStateTitle": "尚未有共享资源",
93+
"emptyStateDesc": "当你共享文件或文件夹时,它们会出现在这里",
94+
"goToFiles": "前往文件",
95+
"typeFile": "文件",
96+
"typeFolder": "文件夹",
97+
"noExpiration": "无过期",
98+
"hasPassword": "",
99+
"noPassword": "",
100+
"editShare": "编辑共享",
101+
"notifyShare": "通知某人",
102+
"copyLink": "复制链接",
103+
"removeShare": "移除共享",
104+
"linkCopied": "链接已复制到剪贴板!",
105+
"linkCopyFailed": "复制链接失败",
106+
"itemUpdated": "共享设置更新成功",
107+
"itemRemoved": "共享已移除成功",
108+
"invalidEmail": "请输入有效的电子邮件地址",
109+
"notificationSent": "通知已成功发送",
110+
"notificationFailed": "发送通知失败"
111+
},
112+
"files": {
113+
"name": "名称",
114+
"type": "类型",
115+
"size": "大小",
116+
"modified": "修改日期",
117+
"no_files": "此文件夹中没有文件",
118+
"view_grid": "网格视图",
119+
"view_list": "列表视图",
120+
"file_types": {
121+
"document": "文档",
122+
"image": "图片",
123+
"video": "视频",
124+
"audio": "音频",
125+
"pdf": "PDF",
126+
"text": "文本",
127+
"folder": "文件夹"
128+
}
129+
},
130+
"dialogs": {
131+
"rename_folder": "重命名文件夹",
132+
"new_name": "新名称",
133+
"move_file": "移动文件",
134+
"select_destination": "选择目标文件夹",
135+
"root": "根目录",
136+
"delete_confirmation": "你确定要删除",
137+
"and_contents": "及其所有内容",
138+
"no_undo": "此操作无法撤销",
139+
"share_file": "共享文件",
140+
"existing_shares": "现有共享",
141+
"share_options": "共享选项",
142+
"password": "密码",
143+
"expiration": "过期日期",
144+
"permissions": "权限",
145+
"generated_link": "生成的链接",
146+
"notify": "发送通知",
147+
"recipient": "收件人",
148+
"message": "消息"
149+
},
150+
"dropzone": {
151+
"drag_files": "将文件拖到这里,或点击选择",
152+
"drop_files": "释放文件以上传"
153+
},
154+
"permissions": {
155+
"read": "读取",
156+
"write": "写入",
157+
"reshare": "再共享"
158+
},
159+
"errors": {
160+
"file_not_found": "文件未找到",
161+
"folder_not_found": "文件夹未找到",
162+
"delete_error": "删除时出错",
163+
"upload_error": "上传文件时出错",
164+
"rename_error": "重命名时出错",
165+
"move_error": "移动时出错",
166+
"empty_name": "名称不能为空",
167+
"name_exists": "已存在同名文件或文件夹",
168+
"generic_error": "发生错误"
169+
},
170+
"breadcrumb": {
171+
"home": "主页"
172+
},
173+
"trash": {
174+
"empty_trash": "清空回收站",
175+
"empty_state": "回收站为空",
176+
"original_location": "原始位置",
177+
"deleted_date": "删除日期",
178+
"actions": "操作",
179+
"restore": "恢复",
180+
"delete_permanently": "永久删除",
181+
"empty_confirm": "你确定要清空回收站吗?这将永久删除所有项目。"
182+
},
183+
"auth": {
184+
"login_title": "登录",
185+
"username": "用户名",
186+
"username_placeholder": "输入你的用户名",
187+
"password": "密码",
188+
"password_placeholder": "输入你的密码",
189+
"login_button": "登录",
190+
"no_account": "没有账号?",
191+
"register": "注册",
192+
"admin_setup": "首次使用?",
193+
"setup": "设置管理员",
194+
"register_title": "创建账号",
195+
"email": "电子邮件",
196+
"email_placeholder": "输入你的电子邮件",
197+
"confirm_password": "确认密码",
198+
"confirm_password_placeholder": "确认你的密码",
199+
"register_button": "创建账号",
200+
"have_account": "已有账号?",
201+
"login": "登录",
202+
"setup_title": "初始设置",
203+
"setup_step1": "管理员",
204+
"setup_step2": "系统",
205+
"setup_step3": "完成",
206+
"admin_username": "管理员用户名",
207+
"admin_email": "管理员电子邮件",
208+
"admin_password": "管理员密码",
209+
"create_admin": "创建管理员",
210+
"back_to_login": "已设置完成?"
211+
},
212+
"viewer": {
213+
"unsupported_file": "无法预览此文件类型。",
214+
"download_file": "下载文件",
215+
"zoom_in": "放大",
216+
"zoom_out": "缩小",
217+
"zoom_reset": "重置缩放"
218+
}
219+
}

0 commit comments

Comments
 (0)