How to add dropdown for multiple languages so that website visitors can change the language.
Hello,
I have created a new .net framework project with the latest version of Umbraco (8.1). I want to add multiple languages to my website. I have already added multiple languages from the Umbraco backend but I want to add a dropdown on the frontend side so that the visitors of the website can change the language as per requirement.
Please help me adding the dropdown in the cshml pages and other required changes so that I can get the options for the dropdown from the Umbraco backend with the languages that I have added to the culture.
I'm not sure you got your answer or not but as I am seeing this question as unanswered, so thought to help you out.
Checkout below code for multiple languages dropdown on website.
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@using Umbraco.Web
@using System.Globalization
@{
// languages
var languages = Model.Root().Cultures;
}
<div class="langs">
<ul>
@foreach (var (culture, infos) in languages)
{
var c = new CultureInfo(culture);
<li class="notranslate" lan-code="@c.Name" href="@Model.Url(culture)">
@c.NativeName @*name of language*@
@c.ThreeLetterISOLanguageName @*name of iso code*@
</li>
}
</ul>
</div>
How to add dropdown for multiple languages so that website visitors can change the language.
Hello,
I have created a new .net framework project with the latest version of Umbraco (8.1). I want to add multiple languages to my website. I have already added multiple languages from the Umbraco backend but I want to add a dropdown on the frontend side so that the visitors of the website can change the language as per requirement.
Please help me adding the dropdown in the cshml pages and other required changes so that I can get the options for the dropdown from the Umbraco backend with the languages that I have added to the culture.
Thanks in Advance
Check out this post
https://our.umbraco.com/forum/umbraco-8/95909-umbraco-v8-multilanguage
It should provide the info you require
Hello,
I'm not sure you got your answer or not but as I am seeing this question as unanswered, so thought to help you out.
Checkout below code for multiple languages dropdown on website.
is working on a reply...