Installation :
install from nuget package manager:
PM> Install-Package LazZiya.TagHelpers
Add tag helpers to _ViewImports.cshtml as below :
@addTagHelper *, LazZiya.TagHelpers
Minimum setup
Version notice
view-context
parameter is required for versions v3.0.0 and earlier, next versions don't need it.
<!-- LazZiya.TagHelpers >= v3.0.1 -->
<language-nav></language-nav>
<!-- LazZiya.TagHelpers <= v3.0.0 -->
<language-nav view-context="ViewContext"></language-nav>
Result :
Manually define supported cultures
Render mode
<language-nav render-mode="Classic">
</language-nav>
Result :
Language label (display text)
Show flags
Available in v4.0 and newer.
To show country flags the culture must contain country code e.g. "tr-TR", "en-US", "ar-sy", ...etc.
Showing flags requires a reference to flag-icon-css and flag attribute:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/css/flag-icon.min.css" />
<language-nav flags="true">
</language-nav>