diff --git a/Data/config.db b/Data/config.db index 054c176..7e8611d 100644 Binary files a/Data/config.db and b/Data/config.db differ diff --git a/Data/exceptions.db b/Data/exceptions.db index e2dcb93..13d0cc1 100644 Binary files a/Data/exceptions.db and b/Data/exceptions.db differ diff --git a/Data/statistics.db b/Data/statistics.db index 0563e32..a495ef3 100644 Binary files a/Data/statistics.db and b/Data/statistics.db differ diff --git a/Data/users.db b/Data/users.db index 2f90e18..121f1cb 100644 Binary files a/Data/users.db and b/Data/users.db differ 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 @@