I have text to localize like this
<p>Please enter your user name and password. @Html.ActionLink(@Resources.Register, "Register") if you don't have an account. </p>
Very often there is an ActionLink in the text.
Can I use something like {0} for the whole ActionLink
@string.Format(Resources.LogOn_Enter_Message, Html.ActionLink(@Resources.Register, "Register"))
(this doesn't work because the link becomes a string)
or do I have to divide the paragraph into 2 parts?
You should do it like this:
@Html.Raw(string.Format(Resources.LogOn_Enter_Message, Html.ActionLink(@Resources.Register, "Register")))
And store your localized string:
<p>Please enter your user name and password. {0} if you don't have an account. </p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With