i18n
i18n copied to clipboard
Is ActionLink extended?
I have noticed that if I use Html.ActionLink (in razor views) I get urls including the language tag like "/en/controller/action"
However if I use Url.Action then I only get "/controller/action" and no language tag first.
Is this because i18n overrides ActionLink? If so, could we do the same for Url.Action?
i18n has been uncoupled from MVC entirely which means that Html.ActionLink won't have been extended.
The reason URL strings generated by Html.ActionLink are being localized is because they are located in well-known locations in the HTML output (e.g. href attributes) which enables i18n to locate them and localize them.
The same is not necessarily true of Url.Action unless you happen to put the generated string in something like an href attribute.
There would be scope for an i18n.MVC helper lib that extends these MVC classes e.g. Url.ActionLocalized etc.. (if you're willing :) ).
This explains it perfectly.
There are a few things I would like to contribute to this project, I just never ever have time :-(