@using System.Globalization

@{
    var currentCulture = CultureInfo.CurrentUICulture.Name;
    var returnUrl = $"{Context.Request.PathBase}{Context.Request.Path}{Context.Request.QueryString}";
}

<form class="language-switcher" asp-area="" asp-controller="Localization" asp-action="SetLanguage" method="post">
  @Html.AntiForgeryToken()
  <input type="hidden" name="returnUrl" value="@returnUrl" />
  <label class="visually-hidden" for="culture-selector">@L["Language"]</label>
  <select id="culture-selector" name="culture" aria-label="@L["Language"]" data-auto-submit="true">
    <option value="en-US" selected="@(currentCulture == "en-US")">English</option>
    <option value="zh-TW" selected="@(currentCulture == "zh-TW")">繁體中文</option>
  </select>
</form>
