Skip to content

SharedCultureLocalizer

Ziya Mollamahmut edited this page Mar 19, 2020 · 3 revisions

The other option to localize views is using the built-in ISharedCultureLocalizer

@using LazZiya.ExpressLocalization
@inject ISharedCultureLocalizer _loc
  • call localization function to get localized strings in views:
<h1 class="display-4">@_loc["Welcome"]</h1>

But when it comes to localize long strings with html tags this approach become unfriendly. That's why the recommended localization approach is using Localize TagHelper.

Applies to ExpressLocalization versions:

4.0

Clone this wiki locally