Language Navigation TagHelper

This page will demonstrate different samples for Langauge Navigation TagHelper settings.

For latest upates visit : LangaugeNav wiki page
Github repository : LazZiya.TagHelpers

Installation :

install from nuget package manager:

    PM> Install-Package LazZiya.TagHelpers

Add tag helpers to _ViewImports.cshtml as below :


    @addTagHelper *, LazZiya.TagHelpers


Minimum setup

                
<!-- 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


<language-nav supported-cultures="en,ar-SY,tr">
</language-nav>

Result :


Render mode


<language-nav render-mode="Classic">
</language-nav>

Result :


Language label (display text)


Show flags

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>

Result :