AbpLocalizationController 位于源代码中
src/Abp.AspNetCore/AspNetCore/Mvc/Controllers/AbpLocalizationController.cs
这是改变文化代码:
public virtual ActionResult ChangeCulture(string cultureName, string returnUrl = "")
{
if (!GlobalizationHelper.IsValidCultureCode(cultureName))
{
throw new AbpException("Unknown language: " + cultureName + ". It must be a valid culture!");
}
var cookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(cultureName, cultureName));
Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
cookieValue,
new CookieOptions {Expires = Clock.Now.AddYears(2)}
);
if (AbpSession.UserId.HasValue)
{
SettingManager.ChangeSettingForUser(
AbpSession.ToUserIdentifier(),
LocalizationSettingNames.DefaultLanguage,
cultureName
);
}
if (Request.IsAjaxRequest())
{
return Json(new AjaxResponse());
}
if (!string.IsNullOrWhiteSpace(returnUrl) && AbpUrlHelper.IsLocalUrl(Request, returnUrl))
{
return Redirect(returnUrl);
}
return Redirect("/"); //TODO: Go to app root
}
https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Mvc/Controllers/AbpLocalizationController.cs
如果您想调试此代码,请从 github 存储库 fork 项目并将其添加到您的解决方案中。用这个本地项目引用替换您的 abp dll 引用。
同时,您没有提及错误所说的内容。要了解它,请查看网站日志。