@Html.ActionLink 中的定位器

Localizer in @Html.ActionLink

当我的网站必须使用@Html.ActionLink 时,我目前无法尝试在我的网站上使用多种语言。 只是一个精度,它适用于其他一切,它加载了良好的文化并在其他地方展示了良好的语言。

我已经尝试解决的问题:

将所有@Html.ActionLink... 放入.resx 文件中。 查看 Microsoft Docs ASP.NET Core 中的全球化和本地化 喜欢这个示例代码:

<ul class="nav navbar-nav navbar-right ml-auto mt-1">
    <li class="nav-item" id="Register" style="padding-right:20px;">
        @Html.ActionLink(Localizer["Register"], "Index", "Register", null, new { @style = "color:white" })
    </li>
    <li class="nav-item" id="Login">            
        @Html.ActionLink("Login", "/Account/Login", "Identity", null, new { @style = "color:white" })
    </li>
</ul>

所以我的问题是:我怎样才能让语言随着@Html.ActionLink消息的文化而改变?

有什么帮助吗?

尝试:Localizer["Register"].Value