To make an URL within a translatable text we use {0} as placeholder.
So we do:
@string.Format(@translationHelper.GetTranslation("label-ClickToContinue"),
@Html.ActionLink(
@translationHelper.GetTranslation("text-here"),
"Login",
new { Model.UserName, Model.UniqueId }
)
)
Translation keys:
label-ClickToContinue = "Click {0} to continue"
text-here = "here"
But this prints the escaped string into the source: <a href="/Login/Login?UserName=alberttest3&amp;UniqueId=f3647fed-bab4-4575-bb5f-98ed27edff43">label-RequestNewOfficeWizard</a>
How to make sure that it’ll not show the html-tag, but the URL?
It easy just put the output from
string.Format()inside aHtml.Raw()like this:Translation keys: