I have a multi-language website and views content (including the markup) can differ from language to language. That's why I cannot just localize strings and put them into resources.
For example, my view in Russian:
<div class="card">
<div class="card-image">
<img src="~/Images/CardHeaders/Business_CreditsSME.jpg" />
</div>
<div class="card-content">
Text
</div>
</div>
View in English:
<p>Text</p>
I see two ways to localize this:
Create Page.cshtml and Page.en.cshtml, and create a custom
LocaleView()
method in controller which will use the localized view files.- The problem is that Views do not always differ. It means that sometimes I will duplicate the markup.
Copy all the HTML markup in my resources as it is, and use
Html.Raw(Resources.PageView)
.- It is not convenient to create, modify or read HTML which is located in a resource flies
- Moreover, I do not like
Html.Raw
method at all and prefer not to use it anywhere
How do you localize large views of different structures?