From e38d4d76a2a5afd896a17bab8b19fd3420a0c93c Mon Sep 17 00:00:00 2001 From: zel Date: Fri, 7 Feb 2025 16:16:10 +0800 Subject: [PATCH] 1 --- Data/config.db | Bin 106496 -> 106496 bytes Data/exceptions.db | Bin 65536 -> 65536 bytes Data/statistics.db | Bin 24576 -> 24576 bytes Data/users.db | Bin 565248 -> 565248 bytes .../Pages/Account/ForgotPassword.cshtml | 13 +- .../Identity/Pages/Account/Lockout.cshtml | 2 +- .../Areas/Identity/Pages/Account/Login.cshtml | 44 ++----- .../Identity/Pages/Account/Logout.cshtml | 8 +- .../Account/Manage/ChangePassword.cshtml | 14 +-- .../Pages/Account/Manage/Index.cshtml.cs | 2 +- .../Pages/Account/Manage/_ManageNav.cshtml | 11 +- TightWiki/Controllers/AccountController.cs | 6 +- TightWiki/Controllers/AdminController.cs | 112 +++++++++--------- TightWiki/Controllers/FileController.cs | 24 ++-- TightWiki/Controllers/PageController.cs | 8 +- TightWiki/Controllers/ProfileController.cs | 4 +- TightWiki/Pages/Privacy.cshtml | 2 +- TightWiki/Pages/Shared/_LoginPartial.cshtml | 4 +- TightWiki/Views/Admin/Account.cshtml | 4 +- TightWiki/Views/Admin/Accounts.cshtml | 2 +- TightWiki/Views/Admin/AddAccount.cshtml | 2 +- TightWiki/Views/Admin/DeleteAccount.cshtml | 10 +- TightWiki/Views/Profile/My.cshtml | 4 +- TightWiki/Views/Shared/_Layout.cshtml | 2 +- 24 files changed, 119 insertions(+), 159 deletions(-) diff --git a/Data/config.db b/Data/config.db index 054c1761cdbd88713c8791985c42150faafa8db9..7e8611d747d94ffd0d4856a5cb1ad4bdef352e9a 100644 GIT binary patch delta 75 zcmZoTz}9epZGtr8;)ycOtcw}+stPxz6vk^6Sr|l`xVa}qWamV>L}oY}>!&6bg$Grc fng*AoWn22?rUj%0=jIu?CpZ6(-~KUBrP`R{m9a5IruW@6 z%?~57?1znMwY*MYbc4DI`$b)sPF**U{R8t)*q0_R-F^|r5Qh6<_vNKYm#qkUaCz^2 z?m3@x?)jW^^ZAy1zUA60u2F}>(IHlgSk47+sA+U{a>c#p1@{vHIQF=oxu3e96!v!f z=x!DN9fO6ZooyYiA!}1SFN)P(X!rkd)$(^3)7=LQ&!#IEr821D*%Sj^SEx3^=!_x* z!vhQmhlbsAu?paeohE7;CcLK=$P5xr1{H}5XTq|R0W?zueW*?=V5r47KB8Bze<jX zVSfnugFVNN_xSzzSTNAtBjSotr5C$dnk zruPt|$zhUA$fRymllwUu_|S72AyR3ZXs#hB5~=?qi+X2>8oNFUgq;r8rTF5Rf%4*N zaeaRC;b-RjE%W*}rKK;55Ax=nugx3xe!a0)x;AfqwQMeZXx{$3ynLs8d$F`~#r)v9 zZD0Q6{o;df&82lSS1~GGy;53VeEi*Id%N`Ir<->_F0HI?uHD+m&)J%yv@jdNZvnTJ^F}lt=t7)Mfp*9>Q60Y>=xQvu z_GR<+>lQce?UQgXmLyJDUm_kqD#q(n;vz^K>0ETY@xyPuTPJMH)bfwfO3m!Va9ESQ zk!=7XRzdB}dN&Y7eOuw%Xsw}RMSNCF)KJer3uD?eKyp<%tUH$?)z^p5=30gF->!e=d~>!>pcc+Mv(wlk09DD qL)nz^(9>x=^Z1M<&+q@bn$|l5wW}#0Zl|L-)ZHBl9`CyO6Z#uM8Cq-r delta 122 zcmZo@U}G*ftYVIkHMGzO%s$E8PzwdEWFCcZen6+Zf;-!7SezSnOd4z Lm|B`HdY}LRxE~&7 diff --git a/Data/statistics.db b/Data/statistics.db index 0563e32e516999cd3c6d6037c7a9deec71610ff1..a495ef30eea482fed3155ee02b023658a044fbc5 100644 GIT binary patch delta 2437 zcmaKudu$X{6vn%ccDvm^BDO*V%K}@dD8qfvy(6@@6qSbsq=E(7QlN#U6 z318C*--f=v_{M&vzWBkK9m9PM@1kI|vDjaflGBp2A*UiInteI@VD^galI(C+Yt}1S zv$F2Zyqfu8W^?Aa%wCaiBfBCE5t?x$08n((_^7u zLx)2vL!(2PY3I|nr`4qmOTCu*aq6?FWv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x#mBjbcn}XN=r)3Ag)%UY%l|jueDk00yRh1Q zVYU0xZi2hKN1!+m96rCSULGbg&9B2-JsmUvPWLiIi-@ORxR>eM^eo-q^m=Z%$>TMl zantlyqhY-#7Y_w=R>=prcsv*A&9R|Cgbl?bY?KRWc@6;34?5klRn$saFD|gxEzc^! zT87#bt!@k!s--E=V&^SW!HdV%QWWTN%eqm)hm2aX4JL_qtA zb_T}*EyuBHC>jdn)JQnMg`?}XhV(!@7VpvGF+Cn-)yClaR5hDCb#}(ekBe$=q$miJ zqcdkpV`nOsUXBc!Gx}t@hlyF~$q_kf$mNkzSdSb#J(A1mQBfM3niUQg1_q|br(@!@ z$a7hNKRz}(G&Lbk9E)Y->`*o;9Tf)^wPctHqpX;Pyb-kK$}amu5$GkbM{~R9Ir1MO zWdbKF`0(?quBBUu*#GD|B6gSUw|Yuf{iF=B=nS?pjjc@itGM9>>_d~-O5RWUF|$v& znuOgt zPAdfs3Pnm@aAMu7Xj$bxhMCV7wZ;#VJpz*jo29VWr7v%Zfk-0kkh`$-e>xpZt$ZL{ zp1+;?uil^weF9FjNTSE6iN2vX=ssFSi#B7SrRxa#P6|%a3k4A-DbfvLy3pEEJISz} zzhNrAF-tL3rK0-AZMz^32ey+3A-`VN#=KQgthowI*hRe!_P5r)7N1%1z-`phl^rnf fsJ8>&?Q2zTU4nIqtV@o%MAfCXy5zhkwM)MM$<4zK diff --git a/TightWiki/Areas/Identity/Pages/Account/ForgotPassword.cshtml b/TightWiki/Areas/Identity/Pages/Account/ForgotPassword.cshtml index f744b70..cf67397 100644 --- a/TightWiki/Areas/Identity/Pages/Account/ForgotPassword.cshtml +++ b/TightWiki/Areas/Identity/Pages/Account/ForgotPassword.cshtml @@ -5,23 +5,14 @@ }

- Forgot your password? + 忘记密码?

-

Enter your email.


-
- -
- - - -
- -
+ 请联系系统管理员为您重置您的密码。
diff --git a/TightWiki/Areas/Identity/Pages/Account/Lockout.cshtml b/TightWiki/Areas/Identity/Pages/Account/Lockout.cshtml index 3012ade..5340338 100644 --- a/TightWiki/Areas/Identity/Pages/Account/Lockout.cshtml +++ b/TightWiki/Areas/Identity/Pages/Account/Lockout.cshtml @@ -5,7 +5,7 @@ }

- Locked out + 登出

This account has been locked out, please try again later.

diff --git a/TightWiki/Areas/Identity/Pages/Account/Login.cshtml b/TightWiki/Areas/Identity/Pages/Account/Login.cshtml index aad951b..aa4433f 100644 --- a/TightWiki/Areas/Identity/Pages/Account/Login.cshtml +++ b/TightWiki/Areas/Identity/Pages/Account/Login.cshtml @@ -6,6 +6,12 @@ var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null."); } + +
@@ -24,7 +30,7 @@
@@ -32,7 +38,7 @@
-

+

忘记密码?

@@ -40,40 +46,6 @@

-
- @{ - if ((Model.ExternalLogins?.Count ?? 0) > 0) - { -
-
-

- @foreach (var provider in Model.ExternalLogins!) - { - if (provider.Name == "Google") - { - - } - else if (provider.Name == "Microsoft") - { - - } - else - { - - } - } -

-
-
- } - } -
diff --git a/TightWiki/Areas/Identity/Pages/Account/Logout.cshtml b/TightWiki/Areas/Identity/Pages/Account/Logout.cshtml index ecb3aad..b564062 100644 --- a/TightWiki/Areas/Identity/Pages/Account/Logout.cshtml +++ b/TightWiki/Areas/Identity/Pages/Account/Logout.cshtml @@ -5,11 +5,11 @@ }

- Logout + 退出

- Logging out will make sure that others cant use this session to make changes to the wiki. You'll need to log back in before making changes.

+ 退出登录前确保其他人没有在使用当前会话,退出后您需要重新登录


@@ -18,12 +18,12 @@ if (User.Identity?.IsAuthenticated ?? false) {
- +
} else { -

You have successfully logged out of the application.

+

操作成功

} } diff --git a/TightWiki/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml b/TightWiki/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml index 09cc7ce..7dbfd77 100644 --- a/TightWiki/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml +++ b/TightWiki/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml @@ -13,21 +13,21 @@
- - + +
- - + +
- - + +
- +
diff --git a/TightWiki/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs b/TightWiki/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs index c0a3a71..2b03a2b 100644 --- a/TightWiki/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs +++ b/TightWiki/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs @@ -12,7 +12,7 @@ namespace TightWiki.Areas.Identity.Pages.Account.Manage { public IActionResult OnGetAsync() { - return Redirect($"{GlobalConfiguration.BasePath}/Identity/Account/Manage/Email"); + return Redirect($"{GlobalConfiguration.BasePath}/Identity/Account/Manage/ChangePassword"); } } } diff --git a/TightWiki/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml b/TightWiki/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml index 4e8fb9d..3899a7b 100644 --- a/TightWiki/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml +++ b/TightWiki/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml @@ -1,14 +1,9 @@ @inject SignInManager SignInManager @{ - var hasExternalLogins = (await SignInManager.GetExternalAuthenticationSchemesAsync()).Any(); var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null."); } diff --git a/TightWiki/Controllers/AccountController.cs b/TightWiki/Controllers/AccountController.cs index cdb3a1a..e4b211c 100644 --- a/TightWiki/Controllers/AccountController.cs +++ b/TightWiki/Controllers/AccountController.cs @@ -48,13 +48,13 @@ namespace TightWiki.Controllers returnUrl ??= Url.Content("~/"); if (remoteError != null) { - return NotifyOfError($"Error from external provider: {remoteError}"); + return NotifyOfError($"外部提供程序出错: {remoteError}"); } var info = await SignInManager.GetExternalLoginInfoAsync(); if (info == null) { - return NotifyOfError($"Failed to get information from external provider"); + return NotifyOfError($"无法从外部提供程序获取信息"); } var user = await UserManager.FindByLoginAsync(info.LoginProvider, info.ProviderKey); @@ -83,7 +83,7 @@ namespace TightWiki.Controllers var email = info.Principal.FindFirstValue(ClaimTypes.Email).EnsureNotNull(); if (string.IsNullOrEmpty(email)) { - return NotifyOfError($"The email address was not supplied by the external provider."); + return NotifyOfError($"电子邮件地址不是由外部提供商提供的."); } user = await UserManager.FindByEmailAsync(email); diff --git a/TightWiki/Controllers/AdminController.cs b/TightWiki/Controllers/AdminController.cs index ea70490..5296c8e 100644 --- a/TightWiki/Controllers/AdminController.cs +++ b/TightWiki/Controllers/AdminController.cs @@ -81,23 +81,23 @@ namespace TightWiki.Controllers case "Optimize": { var resultText = SpannedRepository.OptimizeDatabase(database); - return NotifyOfSuccess($"Optimization complete. {resultText}", model.YesRedirectURL); + return NotifyOfSuccess($"操作成功 {resultText}", model.YesRedirectURL); } case "Vacuum": { var resultText = SpannedRepository.OptimizeDatabase(database); - return NotifyOfSuccess($"Vacuum complete. {resultText}", model.YesRedirectURL); + return NotifyOfSuccess($"操作成功 {resultText}", model.YesRedirectURL); } case "Verify": { var resultText = SpannedRepository.OptimizeDatabase(database); - return NotifyOfSuccess($"Verification complete. {resultText}", model.YesRedirectURL); + return NotifyOfSuccess($"验证完成 {resultText}", model.YesRedirectURL); } } } catch (Exception ex) { - return NotifyOfError($"Operation failed: {ex.Message}.", model.YesRedirectURL); + return NotifyOfError($"操作失败: {ex.Message}.", model.YesRedirectURL); } return NotifyOfError($"Unknown database action: '{databaseAction}'.", model.YesRedirectURL); @@ -138,7 +138,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { StatisticsRepository.PurgeCompilationStatistics(); - return NotifyOfSuccess("Compilation statistics purged.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -153,7 +153,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { WikiCache.Clear(); - return NotifyOfSuccess("Memory cache purged.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -367,12 +367,12 @@ namespace TightWiki.Controllers int currentPageRevision = PageRepository.GetCurrentPageRevision(page.Id); if (revision >= currentPageRevision) { - return NotifyOfError("You cannot revert to the current page revision."); + return NotifyOfError("操作失败"); } Engine.Implementation.Helpers.UpsertPage(tightEngine, page, SessionState); - return NotifyOfSuccess("The page has been reverted.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -396,7 +396,7 @@ namespace TightWiki.Controllers var page = PageRepository.GetLimitedPageInfoByIdAndRevision(pageId); if (page == null) { - return NotifyOfError("The specified page could not be found."); + return NotifyOfError("找不到指定页面"); } model.Name = page.Name; @@ -489,13 +489,13 @@ namespace TightWiki.Controllers var page = PageRepository.GetPageInfoByNavigation(pageNavigation); if (page == null) { - return NotifyOfError("The page could not be found."); + return NotifyOfError("无法找到指定页面"); } int revisionCount = PageRepository.GetPageRevisionCountByPageId(page.Id); if (revisionCount <= 1) { - return NotifyOfError("You cannot delete the only existing revision of a page, instead you would need to delete the entire page."); + return NotifyOfError("唯一修订无法删除"); } //If we are deleting the latest revision, then we need to grab the previous @@ -509,7 +509,7 @@ namespace TightWiki.Controllers PageRepository.MovePageRevisionToDeletedById(page.Id, revision, SessionState.Profile.EnsureNotNull().UserId); - return NotifyOfSuccess("Page revision has been moved to the deletion queue.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功页面修订已移至删除队列", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -575,7 +575,7 @@ namespace TightWiki.Controllers { Engine.Implementation.Helpers.RefreshPageMetadata(tightEngine, page, SessionState); } - return NotifyOfSuccess("All pages have been rebuilt.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -621,7 +621,7 @@ namespace TightWiki.Controllers workload.WaitForCompletion(); - return NotifyOfSuccess("All pages have been cached.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -637,7 +637,7 @@ namespace TightWiki.Controllers { PageRepository.TruncateAllPageRevisions("YES"); WikiCache.Clear(); - return NotifyOfSuccess("All page revisions have been truncated.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -652,7 +652,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageRepository.PurgeDeletedPageRevisionsByPageId(pageId); - return NotifyOfSuccess("The page deletion queue has been purged.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -667,7 +667,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageRepository.PurgeDeletedPageRevisionByPageIdAndRevision(pageId, revision); - return NotifyOfSuccess("The page revision has been purged from the deletion queue.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -682,7 +682,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageRepository.RestoreDeletedPageRevisionByPageIdAndRevision(pageId, revision); - return NotifyOfSuccess("The page revision has been restored.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -697,7 +697,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageRepository.PurgeDeletedPages(); - return NotifyOfSuccess("The page deletion queue has been purged.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -712,7 +712,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageRepository.PurgeDeletedPageByPageId(pageId); - return NotifyOfSuccess("The page has been purged from the deletion queue.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -727,7 +727,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageRepository.MovePageToDeletedById(pageId, SessionState.Profile.EnsureNotNull().UserId); - return NotifyOfSuccess("The page has been moved to the deletion queue.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -747,7 +747,7 @@ namespace TightWiki.Controllers { Engine.Implementation.Helpers.RefreshPageMetadata(tightEngine, page, SessionState); } - return NotifyOfSuccess("The page has restored.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -798,7 +798,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageFileRepository.PurgeOrphanedPageAttachments(); - return NotifyOfSuccess("All orphaned page attachments have been purged.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -814,7 +814,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { PageFileRepository.PurgeOrphanedPageAttachment(pageFileId, revision); - return NotifyOfSuccess("The pages orphaned attachments have been purged.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); @@ -883,7 +883,7 @@ namespace TightWiki.Controllers if (ConfigurationRepository.GetAllMenuItems().Where(o => o.Name.Equals(model.Name, StringComparison.InvariantCultureIgnoreCase) && o.Id != model.Id).Any()) { - ModelState.AddModelError("Name", $"The menu name '{model.Name}' is already in use."); + ModelState.AddModelError("Name", $"菜单名 '{model.Name}' 已被使用"); return View(model); } @@ -892,14 +892,14 @@ namespace TightWiki.Controllers model.Id = ConfigurationRepository.InsertMenuItem(model.ToDataModel()); ModelState.Clear(); - return NotifyOfSuccess("The menu item has been created.", $"/Admin/MenuItem/{model.Id}"); + return NotifyOfSuccess("创建成功", $"/Admin/MenuItem/{model.Id}"); } else { ConfigurationRepository.UpdateMenuItemById(model.ToDataModel()); } - model.SuccessMessage = "The menu item has been saved."; + model.SuccessMessage = "操作成功!"; return View(model); } @@ -926,7 +926,7 @@ namespace TightWiki.Controllers { ConfigurationRepository.DeleteMenuItemById(model.Id); - return NotifyOfSuccess("The menu item has been deleted.", $"/Admin/MenuItems"); + return NotifyOfSuccess("删除成功", $"/Admin/MenuItems"); } return Redirect($"{GlobalConfiguration.BasePath}/Admin/MenuItem/{model.Id}"); @@ -1057,7 +1057,7 @@ namespace TightWiki.Controllers { if (UsersRepository.DoesProfileAccountExist(model.AccountProfile.AccountName)) { - ModelState.AddModelError("AccountProfile.AccountName", "Account name is already in use."); + ModelState.AddModelError("AccountProfile.AccountName", "用户名已经被使用"); return View(model); } } @@ -1066,7 +1066,7 @@ namespace TightWiki.Controllers { if (UsersRepository.DoesEmailAddressExist(model.AccountProfile.EmailAddress)) { - ModelState.AddModelError("AccountProfile.EmailAddress", "Email address is already in use."); + ModelState.AddModelError("AccountProfile.EmailAddress", "该邮箱已经存在"); return View(model); } } @@ -1076,11 +1076,11 @@ namespace TightWiki.Controllers { if (GlobalConfiguration.AllowableImageTypes.Contains(file.ContentType.ToLower()) == false) { - model.ErrorMessage += "Could not save the attached image, type not allowed.\r\n"; + model.ErrorMessage += "无法保存附件图片, 不允许的格式.\r\n"; } else if (file.Length > GlobalConfiguration.MaxAvatarFileSize) { - model.ErrorMessage += "Could not save the attached image, too large.\r\n"; + model.ErrorMessage += "无法保存附件图片, 图片过大.\r\n"; } else { @@ -1092,7 +1092,7 @@ namespace TightWiki.Controllers } catch { - model.ErrorMessage += "Could not save the attached image.\r\n"; + model.ErrorMessage += "无法保存附件图片.\r\n"; } } } @@ -1167,7 +1167,7 @@ namespace TightWiki.Controllers } } - model.SuccessMessage = "Your profile has been saved successfully!"; + model.SuccessMessage = "操作成功!"; return View(model); } @@ -1228,19 +1228,19 @@ namespace TightWiki.Controllers if (string.IsNullOrWhiteSpace(model.AccountProfile.AccountName)) { - ModelState.AddModelError("AccountProfile.AccountName", "Account name is required."); + ModelState.AddModelError("AccountProfile.AccountName", "用户名为必填项"); return View(model); } if (UsersRepository.DoesProfileAccountExist(model.AccountProfile.AccountName)) { - ModelState.AddModelError("AccountProfile.AccountName", "Account name is already in use."); + ModelState.AddModelError("AccountProfile.AccountName", "用户名已经在使用"); return View(model); } if (UsersRepository.DoesEmailAddressExist(model.AccountProfile.EmailAddress)) { - ModelState.AddModelError("AccountProfile.EmailAddress", "Email address is already in use."); + ModelState.AddModelError("AccountProfile.EmailAddress", "邮箱已经被使用"); return View(model); } @@ -1298,11 +1298,11 @@ namespace TightWiki.Controllers { if (GlobalConfiguration.AllowableImageTypes.Contains(file.ContentType.ToLower()) == false) { - model.ErrorMessage += "Could not save the attached image, type not allowed.\r\n"; + model.ErrorMessage += "无法保存附件图片, 不支持的格式.\r\n"; } else if (file.Length > GlobalConfiguration.MaxAvatarFileSize) { - model.ErrorMessage += "Could not save the attached image, too large.\r\n"; + model.ErrorMessage += "无法保存附件图片, 图片过大.\r\n"; } else { @@ -1314,12 +1314,12 @@ namespace TightWiki.Controllers } catch { - model.ErrorMessage += "Could not save the attached image."; + model.ErrorMessage += "无法保存附件图片."; } } } - return NotifyOf("The account has been created.", model.ErrorMessage, $"/Admin/Account/{profile.Navigation}"); + return NotifyOf("创建成功", model.ErrorMessage, $"/Admin/Account/{profile.Navigation}"); } [Authorize] @@ -1367,7 +1367,7 @@ namespace TightWiki.Controllers var user = UserManager.FindByIdAsync(profile.UserId.ToString()).Result; if (user == null) { - return NotFound("User not found."); + return NotFound("404 404 404"); } var result = UserManager.DeleteAsync(user).Result; @@ -1384,10 +1384,10 @@ namespace TightWiki.Controllers //We're deleting our own account. Oh boy... SignInManager.SignOutAsync(); - return NotifyOfSuccess("Your account has been deleted.", $"/Profile/Deleted"); + return NotifyOfSuccess("操作成功", $"/Profile/Deleted"); } - return NotifyOfSuccess("The account has been deleted.", $"/Admin/Accounts"); + return NotifyOfSuccess("操作成功", $"/Admin/Accounts"); } return Redirect($"{GlobalConfiguration.BasePath}/Admin/Account/{navigation}"); @@ -1498,7 +1498,7 @@ namespace TightWiki.Controllers WikiCache.ClearCategory(WikiCache.Category.Configuration); - model.SuccessMessage = "The configuration has been saved successfully!"; + model.SuccessMessage = "操作成功!"; } catch (Exception ex) { @@ -1577,7 +1577,7 @@ namespace TightWiki.Controllers var checkName = EmojiRepository.GetEmojiByName(model.Emoji.Name.ToLowerInvariant()); if (checkName != null) { - ModelState.AddModelError("Emoji.Name", "Emoji name is already in use."); + ModelState.AddModelError("Emoji.Name", "Emoji名称已经被使用"); return View(model); } } @@ -1594,7 +1594,7 @@ namespace TightWiki.Controllers { if (file.Length > GlobalConfiguration.MaxEmojiFileSize) { - model.ErrorMessage += "Could not save the attached image, too large."; + model.ErrorMessage += "无法保存附件图片, 图片过大."; } else { @@ -1606,14 +1606,14 @@ namespace TightWiki.Controllers } catch { - model.ErrorMessage += "Could not save the attached image."; + model.ErrorMessage += "无法保存附件图片."; } } } emoji.Id = EmojiRepository.UpsertEmoji(emoji); model.OriginalName = model.Emoji.Name; - model.SuccessMessage = "The emoji has been saved successfully!"; + model.SuccessMessage = "操作成功!"; model.Emoji.Id = (int)emoji.Id; ModelState.Clear(); @@ -1621,7 +1621,7 @@ namespace TightWiki.Controllers if (nameChanged) { - return NotifyOfSuccess("The emoji has been saved.", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}"); + return NotifyOfSuccess("操作成功", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}"); } return View(model); @@ -1664,7 +1664,7 @@ namespace TightWiki.Controllers var checkName = EmojiRepository.GetEmojiByName(model.Name.ToLower()); if (checkName != null) { - ModelState.AddModelError("Name", "Emoji name is already in use."); + ModelState.AddModelError("Name", "Emoji名已经存在"); return View(model); } } @@ -1681,7 +1681,7 @@ namespace TightWiki.Controllers { if (file.Length > GlobalConfiguration.MaxEmojiFileSize) { - ModelState.AddModelError("Name", "Could not save the attached image, too large."); + ModelState.AddModelError("Name", "无法保存附件图片, 图片过大."); } else { @@ -1693,14 +1693,14 @@ namespace TightWiki.Controllers } catch { - ModelState.AddModelError("Name", "Could not save the attached image."); + ModelState.AddModelError("Name", "无法保存附件图片."); } } } EmojiRepository.UpsertEmoji(emoji); - return NotifyOfSuccess("The emoji has been created.", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}"); + return NotifyOfSuccess("操作成功", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}"); } [Authorize] @@ -1716,7 +1716,7 @@ namespace TightWiki.Controllers { EmojiRepository.DeleteById(emoji.Id); - return NotifyOfSuccess("The emoji has been deleted.", $"/Admin/Emojis"); + return NotifyOfSuccess("操作成功", $"/Admin/Emojis"); } return Redirect($"{GlobalConfiguration.BasePath}/Admin/Emoji/{name}"); @@ -1793,7 +1793,7 @@ namespace TightWiki.Controllers if (model.UserSelection == true) { ExceptionRepository.PurgeExceptions(); - return NotifyOfSuccess("All exceptions have been purged.", model.YesRedirectURL); + return NotifyOfSuccess("操作成功", model.YesRedirectURL); } return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}"); diff --git a/TightWiki/Controllers/FileController.cs b/TightWiki/Controllers/FileController.cs index 3e5cdd4..e507993 100644 --- a/TightWiki/Controllers/FileController.cs +++ b/TightWiki/Controllers/FileController.cs @@ -19,7 +19,7 @@ namespace TightWiki.Controllers : WikiControllerBase(signInManager, userManager) { /// - /// Gets an image attached to a page. + /// 获取附加到页面的图像 /// /// The navigation link of the page. /// The navigation link of the file. @@ -97,7 +97,7 @@ namespace TightWiki.Controllers } else { - return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}]."); + return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到."); } } @@ -176,7 +176,7 @@ namespace TightWiki.Controllers } else { - return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}]."); + return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到."); } } @@ -205,7 +205,7 @@ namespace TightWiki.Controllers else { HttpContext.Response.StatusCode = 404; - return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}]."); + return NotFound($"[{fileNavigation}] 无法在页面 [ {pageNavigation} ] 中找到."); } } @@ -288,7 +288,7 @@ namespace TightWiki.Controllers { if (fileSize > GlobalConfiguration.MaxAttachmentFileSize) { - return Json(new { message = $"Could not attach file: [{file.FileName}], too large." }); + return Json(new { message = $"无法保存文件: [{file.FileName}], 文件过大." }); } var fileName = HttpUtility.UrlDecode(file.FileName); @@ -310,8 +310,8 @@ namespace TightWiki.Controllers } catch (Exception ex) { - ExceptionRepository.InsertException(ex, "Failed to upload file."); - return StatusCode(500, new { success = false, message = $"An error occurred: {ex.Message}" }); + ExceptionRepository.InsertException(ex, "文件上传失败."); + return StatusCode(500, new { success = false, message = $"Error: {ex.Message}" }); } } @@ -337,7 +337,7 @@ namespace TightWiki.Controllers { if (fileSize > GlobalConfiguration.MaxAttachmentFileSize) { - return Content("Could not save the attached file, too large"); + return Content("附件无法保存, 文件过大"); } var fileName = HttpUtility.UrlDecode(fileData.FileName); @@ -353,11 +353,11 @@ namespace TightWiki.Controllers ContentType = Utility.GetMimeType(fileName) }, (SessionState.Profile?.UserId).EnsureNotNullOrEmpty()); - return Content("Success"); + return Content("成功"); } } - return Content("Failure"); + return Content("失败"); } /// @@ -415,7 +415,7 @@ namespace TightWiki.Controllers if (emoji.ImageData == null) { - return NotFound($"Emoji {pageNavigation} was not found"); + return NotFound($"Emoji {pageNavigation} 无法找到"); } WikiCache.Put(imageCacheKey, emoji.ImageData); @@ -475,7 +475,7 @@ namespace TightWiki.Controllers } } - return NotFound($"Emoji {pageNavigation} was not found"); + return NotFound($"Emoji {pageNavigation} 无法找到"); } } } diff --git a/TightWiki/Controllers/PageController.cs b/TightWiki/Controllers/PageController.cs index 1f72787..e0a0804 100644 --- a/TightWiki/Controllers/PageController.cs +++ b/TightWiki/Controllers/PageController.cs @@ -640,7 +640,7 @@ namespace TightWiki.Controllers SessionState.SetPageId(page.Id); - model.SuccessMessage = "The page was saved."; + model.SuccessMessage = "保存成功"; if (string.IsNullOrWhiteSpace(originalNavigation) == false) { @@ -736,7 +736,7 @@ namespace TightWiki.Controllers } else { - return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}]."); + return NotFound($"[{fileNavigation}] 无法在页面 [ {pageNavigation} ] 中找到."); } } @@ -802,7 +802,7 @@ namespace TightWiki.Controllers } else { - return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}]."); + return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到."); } } @@ -830,7 +830,7 @@ namespace TightWiki.Controllers else { HttpContext.Response.StatusCode = 404; - return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}]."); + return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到."); } } diff --git a/TightWiki/Controllers/ProfileController.cs b/TightWiki/Controllers/ProfileController.cs index f16ebd2..42e228b 100644 --- a/TightWiki/Controllers/ProfileController.cs +++ b/TightWiki/Controllers/ProfileController.cs @@ -347,7 +347,7 @@ namespace TightWiki.Controllers WikiCache.ClearCategory(WikiCacheKey.Build(WikiCache.Category.User, [profile.Navigation])); WikiCache.ClearCategory(WikiCacheKey.Build(WikiCache.Category.User, [profile.UserId])); - model.SuccessMessage = "Your profile has been saved."; + model.SuccessMessage = "保存成功"; //This is not 100% necessary, I just want to prevent the user from needing to refresh to view the new theme. SessionState.UserTheme = ConfigurationRepository.GetAllThemes().SingleOrDefault(o => o.Name == model.AccountProfile.Theme) ?? GlobalConfiguration.SystemTheme; @@ -378,7 +378,7 @@ namespace TightWiki.Controllers var user = UserManager.FindByIdAsync(profile.UserId.ToString()).Result; if (user == null) { - return NotFound("User not found."); + return NotFound("User 404 404 404."); } var result = UserManager.DeleteAsync(user).Result; diff --git a/TightWiki/Pages/Privacy.cshtml b/TightWiki/Pages/Privacy.cshtml index 46ba966..28cc433 100644 --- a/TightWiki/Pages/Privacy.cshtml +++ b/TightWiki/Pages/Privacy.cshtml @@ -5,4 +5,4 @@ }

@ViewData["Title"]

-

Use this page to detail your site's privacy policy.

+

隐私政策.

diff --git a/TightWiki/Pages/Shared/_LoginPartial.cshtml b/TightWiki/Pages/Shared/_LoginPartial.cshtml index dd556e0..5ff6702 100644 --- a/TightWiki/Pages/Shared/_LoginPartial.cshtml +++ b/TightWiki/Pages/Shared/_LoginPartial.cshtml @@ -16,9 +16,9 @@ } else { - + *@ diff --git a/TightWiki/Views/Admin/Account.cshtml b/TightWiki/Views/Admin/Account.cshtml index c5cfdb2..e8975c0 100644 --- a/TightWiki/Views/Admin/Account.cshtml +++ b/TightWiki/Views/Admin/Account.cshtml @@ -6,11 +6,11 @@ }

- Account + 账号

- Configuration for user account.

+ 设置您的账号

diff --git a/TightWiki/Views/Admin/Accounts.cshtml b/TightWiki/Views/Admin/Accounts.cshtml index 45d5419..4283695 100644 --- a/TightWiki/Views/Admin/Accounts.cshtml +++ b/TightWiki/Views/Admin/Accounts.cshtml @@ -45,8 +45,8 @@ Account - First Name Last Name + First Name Country TimeZone EmailAddress diff --git a/TightWiki/Views/Admin/AddAccount.cshtml b/TightWiki/Views/Admin/AddAccount.cshtml index 831ab8d..dde3c8f 100644 --- a/TightWiki/Views/Admin/AddAccount.cshtml +++ b/TightWiki/Views/Admin/AddAccount.cshtml @@ -6,7 +6,7 @@ }

- Add Account + 新增账号

diff --git a/TightWiki/Views/Admin/DeleteAccount.cshtml b/TightWiki/Views/Admin/DeleteAccount.cshtml index 88aeae1..9fa9cf2 100644 --- a/TightWiki/Views/Admin/DeleteAccount.cshtml +++ b/TightWiki/Views/Admin/DeleteAccount.cshtml @@ -19,18 +19,18 @@ {

- Delete account "@Model.AccountName"? + 删除账号 "@Model.AccountName"?
- Deleting "@Model.AccountName" will permanently remove the account. All pages created or modified by this user will be attributed to a stand-in account. - You will not be able to revert this action. + 删除 "@Model.AccountName" 将永久删除该账户.该用户创建的页面将属于一个代理账户. + 您将无法恢复此操作.

- Are you sure you want to continue with this deletion?

+ 您确定要继续此删除操作吗?

@using (Html.BeginForm(null, null, FormMethod.Post, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" })) { -
  
+
  
}
diff --git a/TightWiki/Views/Profile/My.cshtml b/TightWiki/Views/Profile/My.cshtml index 09d0c6f..9089962 100644 --- a/TightWiki/Views/Profile/My.cshtml +++ b/TightWiki/Views/Profile/My.cshtml @@ -203,4 +203,6 @@ }
-
+
+ +
diff --git a/TightWiki/Views/Shared/_Layout.cshtml b/TightWiki/Views/Shared/_Layout.cshtml index 8d94e37..359a50c 100644 --- a/TightWiki/Views/Shared/_Layout.cshtml +++ b/TightWiki/Views/Shared/_Layout.cshtml @@ -207,7 +207,7 @@