This commit is contained in:
zel
2025-02-07 16:16:10 +08:00
parent 83aade6ac7
commit e38d4d76a2
24 changed files with 119 additions and 159 deletions

View File

@@ -19,7 +19,7 @@ namespace TightWiki.Controllers
: WikiControllerBase(signInManager, userManager)
{
/// <summary>
/// Gets an image attached to a page.
/// 获取附加到页面的图像
/// </summary>
/// <param name="givenPageNavigation">The navigation link of the page.</param>
/// <param name="givenFileNavigation">The navigation link of the file.</param>
@@ -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("失败");
}
/// <summary>
@@ -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} 无法找到");
}
}
}