Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

Default.cshtml

@model LanguageSelectorModel

@inject Nop.Core.IWebHelper webHelper

@if (Model.AvailableLanguages.Count > 1)
{
    var returnUrl = webHelper.GetRawUrl(Context.Request);
    var languages = await Model.AvailableLanguages.SelectAwait(async lang => new SelectListItem
                {
                    Text = lang.Name,
                    Value = Url.Action("SetLanguage", "Common", new { langid = lang.Id, area = AreaNames.ADMIN, returnUrl },
                webHelper.GetCurrentRequestProtocol()),
                    Selected = lang.Id.Equals(Model.CurrentLanguage.Id)
                }).ToListAsync();

    
}