0
deltavision created
Hi,
v11.2.1 MVC .NET Core
We wish to update the lang attribute of the html tag, based on the selected language. But can not figure out where to do this.
It should be set when entering the page and when changing the language
2 Answer(s)
-
0
Hi,
You can inject
ILanguageManager
to related _Layout.cshtml file and get current language usingLanguageManager.CurrentLanguage
.@inject ILanguageManager LanguageManager <html lang="@LanguageManager.CurrentLanguage.Name"> <!-- OTHER CODE BLOCKS --> </html>
-
0
Hi @ismcagdas,
works perfectly - thank you