i18n icon indicating copy to clipboard operation
i18n copied to clipboard

Is ActionLink extended?

Open rickardliljeberg opened this issue 8 years ago • 2 comments

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?

rickardliljeberg avatar May 29 '16 14:05 rickardliljeberg

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 :) ).

turquoiseowl avatar Jun 03 '16 10:06 turquoiseowl

This explains it perfectly.

There are a few things I would like to contribute to this project, I just never ever have time :-(

rickardliljeberg avatar Jun 05 '16 11:06 rickardliljeberg