Serving Culture-Dependent Views

In this lesson, we will learn how to localize content by serving culture-specific views.

View content can be localized either by localizing various strings of a unique view or by serving a different view for each of the supported cultures. The first approach is convenient for views whose prevalent content is input fields and HTML structures. The second approach is convenient for view where the content is text with some minimal HTML structure that organizes this text, such as paragraphs, lists, and a few divs.

In this lesson, we will explain how to serve culture-specific views.

Enabling culture-specific views

The usage of culture-specific views can be enabled by chaining the AddViewLocalization method after the AddControllersWithViews call in the ConfigureServices method of “Startup.cs”, as shown in the code below:

Get hands-on with 1200+ tech skills courses.