使用 Microsoft.AspNet.Identity.Core.<culture> 进行身份本地化的示例或教程?

Sample or tutorial to use Microsoft.AspNet.Identity.Core.<culture> for Identity Localization?

我需要本地化(意大利语)我搭建的 Identity/Account 区域的所有页面(我在没有身份验证的情况下启动了 asp.net 3.1 核心项目,然后使用 Add 添加了下面的页面新脚手架项目...)

我发现每种文化都有一个集会Microsoft.AspNet.Identity.Core。 (eg. Microsoft.AspNet.Identity.Core.it),但是我不明白怎么用。

  1. 我尝试加载并引用它,但没有任何变化...您有如何使用的示例吗?
  2. 是否只有在我使用“隐藏”模式时才可用(例如,使用身份验证个人用户帐户创建 asp.net 3.1 项目)?

谢谢 桑德罗

\Areas\Identity\Pages\Account\AccessDenied.cshtml.cs
\Areas\Identity\Pages\Account\ConfirmEmail.cshtml.cs
\Areas\Identity\Pages\Account\ConfirmEmailChange.cshtml.cs
\Areas\Identity\Pages\Account\ExternalLogin.cshtml.cs
\Areas\Identity\Pages\Account\ForgotPassword.cshtml.cs
\Areas\Identity\Pages\Account\ForgotPasswordConfirmation.cshtml.cs
\Areas\Identity\Pages\Account\Lockout.cshtml.cs
\Areas\Identity\Pages\Account\Login.cshtml.cs
\Areas\Identity\Pages\Account\LoginWith2fa.cshtml.cs
\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml.cs
\Areas\Identity\Pages\Account\Logout.cshtml.cs
\Areas\Identity\Pages\Account\Register.cshtml.cs
\Areas\Identity\Pages\Account\RegisterConfirmation.cshtml.cs
\Areas\Identity\Pages\Account\ResendEmailConfirmation.cshtml.cs
\Areas\Identity\Pages\Account\ResetPassword.cshtml.cs
\Areas\Identity\Pages\Account\ResetPasswordConfirmation.cshtml.cs
\Areas\Identity\Pages\Account\Manage\ChangePassword.cshtml.cs
\Areas\Identity\Pages\Account\Manage\DeletePersonalData.cshtml.cs
\Areas\Identity\Pages\Account\Manage\Disable2fa.cshtml.cs
\Areas\Identity\Pages\Account\Manage\DownloadPersonalData.cshtml.cs
\Areas\Identity\Pages\Account\Manage\Email.cshtml.cs
\Areas\Identity\Pages\Account\Manage\EnableAuthenticator.cshtml.cs
\Areas\Identity\Pages\Account\Manage\ExternalLogins.cshtml.cs
\Areas\Identity\Pages\Account\Manage\GenerateRecoveryCodes.cshtml.cs
\Areas\Identity\Pages\Account\Manage\Index.cshtml.cs
\Areas\Identity\Pages\Account\Manage\ManageNavPages.cs
\Areas\Identity\Pages\Account\Manage\PersonalData.cshtml.cs
\Areas\Identity\Pages\Account\Manage\ResetAuthenticator.cshtml.cs
\Areas\Identity\Pages\Account\Manage\SetPassword.cshtml.cs
\Areas\Identity\Pages\Account\Manage\ShowRecoveryCodes.cshtml.cs
\Areas\Identity\Pages\Account\Manage\TwoFactorAuthentication.cshtml.cs
``

I tried to load and reference it, but nothing changes... do you have a sample how to use? Is it usable only if I use the "hidden" mode (eg. create the asp.net 3.1 project with Authentication Individual User Account)?

据我所知,Microsoft.AspNet.Identity.Core 用于 ASP.NET 而不是 ASP.NET 核心。 asp.net 核心身份包是 Microsoft.AspNetCore.Identity。 asp.net核心没有简单易用的asp.net身份

如果您想使用 asp.net 核心标识的本地化,您应该具备 asp.net 核心本地化的基本知识。请参考这个article。您应该知道什么是资源文件并知道它在 asp.net 核心中如何工作以针对不同的文化生成不同的语言。

那你可以参考这个example project,它已经为asp.net核心身份启用了本地化。

您可以直接 Fork 复制,为您要翻译的语言创建资源文件,将新语言添加到 Startup.cs 中 zu-ZA 之前的 supportedCultures 列表中,然后拉取请求进行测试。

注意:本示例项目为2.2。如果你想使用 3.1,你可以按照示例项目为 3.1 项目创建本地化。