diff --git a/README.md b/README.md index 159c4f4..9d79c54 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ npm run dev ## Screenshots -[Check here.](https://github.com/QingdaoU/OnlineJudge/tree/2.0) +[Check here.](https://github.com/QingdaoU/OnlineJudge) ## Browser Support diff --git a/package-lock.json b/package-lock.json index 7abb050..8fb302b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16733,6 +16733,11 @@ "integrity": "sha1-aDvR0CbA07PJN9WHVnnpqH7GzY8=", "dev": true }, + "vue-i18n": { + "version": "7.7.0", + "resolved": "http://registry.npm.taobao.org/vue-i18n/download/vue-i18n-7.7.0.tgz", + "integrity": "sha1-8xdYHg68Q8EoZiUBz6vW7NXn/Os=" + }, "vue-katex": { "version": "0.1.2", "resolved": "http://registry.npm.taobao.org/vue-katex/download/vue-katex-0.1.2.tgz", diff --git a/package.json b/package.json index 3a738f1..96b81bd 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "vue-codemirror-lite": "^1.0.4", "vue-cropper": "^0.2.9", "vue-echarts": "^2.6.0", + "vue-i18n": "^7.7.0", "vue-katex": "^0.1.2", "vue-router": "^3.0.1", "vuex": "^3.0.1", diff --git a/src/i18n/admin/en-US.js b/src/i18n/admin/en-US.js new file mode 100644 index 0000000..0e66cf2 --- /dev/null +++ b/src/i18n/admin/en-US.js @@ -0,0 +1,104 @@ +export const m = { + // SideMenu.vue + Dashboard: 'Dashboard', + General: 'General', + User: 'User', + Announcement: 'Announcement', + System_Config: 'System Config', + Judge_Server: 'Judge Server', + Prune_Test_Case: 'Prune Test Case', + Problem: 'Problem', + Problem_List: 'Problem List', + Create_Problem: 'Create Problem', + Export_Import_Problem: 'Export Or Import Problem', + Contest: 'Contest', + Contest_List: 'Contest List', + Create_Contest: 'Create Contest', + // User.vue + User_User: 'User', + Import_User: 'Import User', + Generate_User: 'Generate User', + // User.vue-dialog + User_Info: 'User', + User_Username: 'Username', + User_Real_Name: 'Real Name', + User_Email: 'Email', + User_New_Password: 'New Password', + User_Type: 'User Type', + Problem_Permission: 'Problem Permission', + Two_Factor_Auth: 'Two Factor Auth', + Is_Disabled: 'Is Disabled', + // Announcement.vue + General_Announcement: 'Announcement', + Announcement_Title: 'Title', + Announcement_Content: 'Conten', + Announcement_Status: 'Status', + // Conf.vue + SMTP_Config: 'SMTP Config', + Server: 'Server', + Port: 'Port', + Email: 'Email', + Password: 'Password', + Website_Config: 'Web Config', + Base_Url: 'Base Url', + Name: 'Name', + Shortcut: 'Shortcut', + Footer: 'Footer', + Allow_Register: 'Allow Register', + Submission_List_Show_All: 'Submission List Show All', + // JudgeServer.vue + Judge_Server_Token: 'Judge Server Token', + Judge_Server_Info: 'Judge Server', + IP: 'IP', + Judger_Version: 'Judger Version', + Service_URL: 'Service URL', + Last_Heartbeat: 'Last Heartbeat', + Create_Time: 'Create Time', + // PruneTestCase + Test_Case_Prune_Test_Case: 'Prune Test Case', + // Problem.vue + Display_ID: 'Display ID', + Title: 'Title', + Description: 'Description', + Input_Description: 'Input Description', + Output_Description: 'Output Description', + Time_Limit: 'Time Limit', + Memory_limit: 'Memory limit', + Difficulty: 'Difficulty', + Visible: 'Visible', + Languages: 'Languages', + Input_Samples: 'Input Samples', + Output_Samples: 'Output Samples', + Add_Sample: 'Add Sample', + Code_Template: 'Code_Template', + Special_Judge: 'Special Judge', + Use_Special_Judge: 'Use Special Judge', + Special_Judge_Code: 'Special Judge Code', + SPJ_language: 'SPJ language', + Compile: 'Compile', + TestCase: 'TestCase', + Type: 'Type', + Input: 'Input', + Output: 'Output', + Score: 'Score', + Hint: 'Hint', + Source: 'Source', + // Contest.vue + ContestTitle: 'Title', + ContestDescription: 'Description', + Contest_Start_Time: 'Start Time', + Contest_End_Time: 'End Time', + Contest_Password: 'Password', + Contest_Rule_Type: 'Contest Rule Type', + Real_Time_Rank: 'Real Time Rank', + Contest_Status: 'Status', + Allowed_IP_Ranges: 'Allowed IP Ranges', + CIDR_Network: 'CIDR Network', + // Dashboard.vue + Last_Login: 'Last Login', + System_Overview: 'System Overview', + DashBoardJudge_Server: 'Judge Server', + HTTPS_Status: 'HTTPS Status', + Force_HTTPS: 'Force HTTPS', + CDN_HOST: 'CDN HOST' +} diff --git a/src/i18n/admin/zh-CN.js b/src/i18n/admin/zh-CN.js new file mode 100644 index 0000000..0495b47 --- /dev/null +++ b/src/i18n/admin/zh-CN.js @@ -0,0 +1,104 @@ +export const m = { + // SideMenu.vue + Dashboard: '仪表盘', + General: '常用设置', + User: '用户管理', + Announcement: '公告管理', + System_Config: '系统配置', + Judge_Server: '判题服务器', + Prune_Test_Case: '测试用例', + Problem: '问题', + Problem_List: '问题列表', + Create_Problem: '增加题目', + Export_Import_Problem: '导入导出题目', + Contest: '测试&练习', + Contest_List: '测试列表', + Create_Contest: '创建测试', + // User.vue + User_User: '用户', + Import_User: '导入用户', + Generate_User: '生成用户', + // User.vue-dialog + User_Info: '用户信息', + User_Username: '用户名', + User_Real_Name: '真实姓名', + User_Email: '用户邮箱', + User_New_Password: '用户密码', + User_Type: '用户类型', + Problem_Permission: '问题权限', + Two_Factor_Auth: '双因素认证', + Is_Disabled: '是否可用', + // Announcement.vue + General_Announcement: '公告', + Announcement_Title: '标题', + Announcement_Content: '内容', + Announcement_Status: '状态', + // Conf.vue + SMTP_Config: 'SMTP Config', + Server: '服务器', + Port: '端口', + Email: '邮箱', + Password: '授权码', + Website_Config: 'Web Config', + Base_Url: 'Base Url', + Name: '名称', + Shortcut: '简称', + Footer: '页脚', + Allow_Register: '是否允许注册', + Submission_List_Show_All: '显示全部题目的提交', + // JudgeServer.vue + Judge_Server_Token: '判题服务器接口', + Judge_Server_Info: '判题服务器', + IP: 'IP', + Judger_Version: '判题机版本', + Service_URL: '服务器URL', + Last_Heartbeat: '上一次心跳', + Create_Time: '创建时间', + // PruneTestCase + Test_Case_Prune_Test_Case: '精简测试用例', + // Problem.vue + Display_ID: 'Display ID', + Title: '题目', + Description: '描述', + Input_Description: '输入描述', + Output_Description: '输出描述', + Time_Limit: '时间限制', + Memory_limit: '内存限制', + Difficulty: '难度', + Visible: '是否可见', + Languages: '可选编程语言', + Input_Samples: '输入样例', + Output_Samples: '输出样例', + Add_Sample: '添加样例', + Code_Template: '代码模板', + Special_Judge: 'Special Judge', + Use_Special_Judge: '使用Special Judge', + Special_Judge_Code: 'Special Judge Code', + SPJ_language: 'SPJ language', + Compile: '编译', + TestCase: '测试用例', + Type: '测试类型', + Input: '输入', + Output: '输出', + Score: '分数', + Hint: '提示', + Source: '来源', + // Contest.vue + ContestTitle: '标题', + ContestDescription: '描述', + Contest_Start_Time: '开始时间', + Contest_End_Time: '结束时间', + Contest_Password: '密码', + Contest_Rule_Type: '规则', + Real_Time_Rank: '实时Rank', + Contest_Status: '状态', + Allowed_IP_Ranges: '允许的IP范围', + CIDR_Network: 'CIDR Network', + // Dashboard.vue + Last_Login: '最后登录状态', + System_Overview: '系统状况', + DashBoardJudge_Server: '判题服务器', + HTTPS_Status: 'HTTPS 状态', + Force_HTTPS: '强制 HTTPS', + CDN_HOST: 'CDN HOST' +} diff --git a/src/i18n/oj/en-US.js b/src/i18n/oj/en-US.js new file mode 100644 index 0000000..4987402 --- /dev/null +++ b/src/i18n/oj/en-US.js @@ -0,0 +1,105 @@ +export const m = { + // Problem.vue + Description: 'Description', + Input: 'Input', + Output: 'Output', + Sample_Input: 'Sample Input', + Sample_Output: 'Sample Output', + Hint: 'Hint', + Source: 'Source', + Status: 'Status', + Information: 'Information', + Time_Limit: 'Time Limit', + Memory_Limit: 'Memory Limit', + Created: 'Created By', + Level: 'Level', + Score: 'Score', + Tags: 'Tags', + Show: 'Show', + // About.vue + Result_Explanation: 'Result Explanation', + Pending_Juding: 'You solution will be judged soon, please wait for result.', + Compile_Error: "Failed to compile your source code. Click on the link to see compiler's output.", + Accepted: 'Congratulations. Your solution is correct.', + Wrong_Answer: "Your program's output doesn't match judger's answer.", + Runtime_Error: 'Your program terminated abnormally. Possible reasons are: segment fault, divided by zero or exited with code other than 0.', + Time_Limit_Exceeded: 'The CPU time your program used has exceeded limit. Java has a triple time limit.', + Memory_Limit_Exceeded: 'The memory your program actually used has exceeded limit.', + System_Error: 'Oops, something has gone wrong with the judger. Please report this to administrator.', + // FAQ.vue + Frequently_Asked_Questions: 'Frequently Asked Questions', + // ContestDetail.vue + Problems: 'Problems', + Announcements: 'Announcements', + Submissions: 'Submissions', + Rankings: 'Rankings', + Overview: 'Overview', + Admin_Helper: 'Admin Helper', + // ContestProblemList + Problems_List: 'Problems List', + + // NavBar.vue + Home: 'Home', + NavProblems: 'Problems', + Contests: 'Contests', + NavStatus: 'Status', + Rank: 'Rank', + ACM_Rank: 'ACM Rank', + OI_Rank: 'OI Rank', + About: 'About', + Judger: 'Judger', + FAQ: 'FAQ', + Login: 'Login', + Register: 'Register', + MyHome: 'Home', + MySubmissions: 'Submissions', + Settings: 'Settings', + Management: 'Management', + Logout: 'Logout', + // announcements.vue + Refresh: 'Refresh', + Back: 'Back', + No_Announcements: 'No Announcements', + // Setting.vue + Profile: 'Profile', + Account: 'Account', + Security: 'Security', + // AccoutSetting.vue + ChangePassword: 'Change Password', + ChangeEmail: 'Change Email', + Update_Password: 'Update Password', + // ProfileSetting.vue + Avatar_Setting: 'Avatar Setting', + Profile_Setting: 'Profile Setting', + // SecuritySettig + Sessions: 'Sessions', + Two_Factor_Authentication: 'Two Factor Authentication', + // Login.vue + LoginUsername: 'Username', + LoginPassword: 'Password', + TFA_Code: 'Code from your TFA app', + No_Account: 'No account? Register now!', + Forget_Password: 'Forget Password', + UserLogin: 'Login', + // Register.vue + RegisterUsername: 'Username', + Email_Address: 'Email Address', + RegisterPassword: 'Password', + Password_Again: 'Password Again', + Captcha: 'Captcha', + UserRegister: 'Register', + Already_Registed: 'Already registed? Login now!', + // ResetPassword.vue and ApplyResetPassword.vue + Reset_Password: 'Lost Password', + RPassword: 'Password', + RPassword_Again: 'Password Again', + RCaptcha: 'Captcha', + ApplyEmail: 'Your Email Address', + Send_Password_Reset_Email: 'Send Password Reset Email', + // UserHome.vue + UserHomeSolved: 'Solved', + UserHomeserSubmissions: 'Submissions', + UserHomeScore: 'Score', + List_Solved_Problems: 'List of solved problems', + UserHomeIntro: 'The guy is so lazy that has not solved any problem yet.' +} diff --git a/src/i18n/oj/zh-CN.js b/src/i18n/oj/zh-CN.js new file mode 100644 index 0000000..fc0a345 --- /dev/null +++ b/src/i18n/oj/zh-CN.js @@ -0,0 +1,105 @@ +export const m = { + // Problem.vue + Description: '题目描述', + Input: '输入', + Output: '输出', + Sample_Input: '输入样例', + Sample_Output: '输出样例', + Hint: '提示', + Source: '题目来源', + Status: '状态', + Information: '题目信息', + Time_Limit: '时间限制', + Memory_Limit: '内存限制', + Created: '出题人', + Level: '难度', + Score: '分数', + Tags: '标签', + Show: '显示', + // About.vue + Result_Explanation: '结果解释', + Pending_Juding: '您的解答将很快被测评,请等待结果。', + Compile_Error: '无法编译您的源代码,点击链接查看编译器的输出。', + Accepted: '你的解题方法是正确的。', + Wrong_Answer: '你的程序输出结果与判题程序的答案不符。', + Runtime_Error: '您的程序异常终止,可能的原因是:段错误,被零除或用非0的代码退出程序。', + Time_Limit_Exceeded: '您的程序使用的CPU时间已超出限制,Java有三倍的时间限制。', + Memory_Limit_Exceeded: '程序实际使用的内存已超出限制。', + System_Error: '糟糕,判题程序出了问题。请报告给管理员。', + // FAQ.vue + Frequently_Asked_Questions: '常见问题', + // ContestDetail.vue + Problems: '题目', + Announcements: '公告', + Submissions: '提交信息', + Rankings: 'Rank排名', + Overview: '概要', + Admin_Helper: '管理员助手', + // ContestProblemList.vue + Problems_List: '问题列表', + + // NavBar.vue + Home: '首页', + NavProblems: '问题', + Contests: '练习&比赛', + NavStatus: '状态', + Rank: '排名', + ACM_Rank: 'ACM 排名', + OI_Rank: 'OI 排名', + About: '关于', + Judger: '判题解释', + FAQ: '常见问题', + Login: '登录', + Register: '注册', + MyHome: '我的主页', + MySubmissions: '我的提交', + Settings: '我的设置', + Management: '后台管理', + Logout: '退出', + // announcements.vue + Refresh: '刷新', + Back: '返回', + No_Announcements: '暂无公告', + // Setting.vue + Profile: '个人信息设置', + Account: '账号设置', + Security: '安全设置', + // AccoutSetting.vue + ChangePassword: '更改密码', + ChangeEmail: '更改邮箱', + Update_Password: '更新密码', + // ProfileSetting.vue + Avatar_Setting: '头像设置', + Profile_Setting: '个人信息设置', + // SecuritySettig + Sessions: '登录记录', + Two_Factor_Authentication: '双因素认证', + // Login.vue + LoginUsername: '用户名', + LoginPassword: '密码', + TFA_Code: '双因素认证号码', + No_Account: '还没账号,立即注册!', + Forget_Password: '忘记密码', + UserLogin: '登录', + // Register.vue + RegisterUsername: '用户名', + Email_Address: '电子邮箱', + RegisterPassword: '密码', + Password_Again: '确认密码', + Captcha: '验证码', + UserRegister: '注册', + Already_Registed: '已经注册?现在登录!', + // ResetPassword.vue and ApplyResetPassword.vue + Reset_Password: '重置密码', + RPassword: '密码', + RPassword_Again: '确认密码', + RCaptcha: '验证码', + ApplyEmail: '电子邮箱', + Send_Password_Reset_Email: '发送重置密码到邮箱', + // UserHome.vue + UserHomeSolved: '已解决数量', + UserHomeserSubmissions: '提交次数', + UserHomeScore: '分数', + List_Solved_Problems: '已解决问题的列表', + UserHomeIntro: '这个家伙太懒了,还没有做题呢...' +} diff --git a/src/pages/admin/components/SideMenu.vue b/src/pages/admin/components/SideMenu.vue index 3b190af..f61c848 100644 --- a/src/pages/admin/components/SideMenu.vue +++ b/src/pages/admin/components/SideMenu.vue @@ -4,24 +4,24 @@ - Dashboard + {{$t('m.Dashboard')}} - - User - Announcement - System Config - Judge Server - Prune Test Case + + {{$t('m.User')}} + {{$t('m.Announcement')}} + {{$t('m.System_Config')}} + {{$t('m.Judge_Server')}} + {{$t('m.Prune_Test_Case')}} - - Problem List - Create Problem + + {{$t('m.Problem_List')}} + {{$t('m.Create_Problem')}} - - Contest List - Create Contest + + {{$t('m.Contest_List')}} + {{$t('m.Create_Contest')}} @@ -48,7 +48,7 @@