@Markus, thank you for your effort it helped a lot.
My setup for test porpuses:
=> Languages: English (en-us) default, Danish (da) and Genman (de)
=> Managed "Culture and Hostnames" for the root node, one url for each culture as you mentioned above.
=> Document Type: Home with setting "Allow varying by culture" set to true on document type, and textstring input named "Language" also set Allow varying by culture to true.
And in Content section for each homepage I added short language name.
As you mentioned in previous post that intlHomePage wolud be Models Builder name, in my case Home if I'm not mistaken -> after runing site I'm getting error that Home is not available in current context so I rename it to Model and it works.
What would I have to do if I wanted a combination of the language chooser on page level as well as on main language level? Let's say I'm on a page that doesn't have a German (or whatever) variant of that specific page, then I'd like to navigate to the German front page instead of directly to the German variant of the current page. How would I go about doing that?
Thanks for the feedback Paul - however it's not working. I'm also not getting the correct links to the correct language version using the code above even if fallback language is selected or not.
I have created a property called Language at the Document type of my home page and this will include the language texts I want to show (NL, FR,DE in my case)
Umbraco v8 Multilanguage
Hi, how to make a language menu to switch between the languages ( two or more) in Umbraco v8?
Hi!
Under "Settings -> Languages", add the languages you want to use.
Then set "Culture and Hostnames" for the root node, one url for each culture.
You also need to set "Allow varying by culture" to true on your document types.
You might need to reload the page to see the language switcher over the content tree (at least I had to do that).
Cheers!
// m
I did that. there is all ok. I need razor code to show language link names all avaiable languages on master layout.
Stephan Gray from the HQ has made some really good presentations on V8 basics over the last months,
https://www.zpqrtbnk.net/documents
In one of them I found this little snippet
Edit: Where intlHomePage would be the Models Builder class name of your current document type.
@Markus, thank you for your effort it helped a lot.
My setup for test porpuses:
=> Languages: English (en-us) default, Danish (da) and Genman (de)
=> Managed "Culture and Hostnames" for the root node, one url for each culture as you mentioned above.
=> Document Type: Home with setting "Allow varying by culture" set to true on document type, and textstring input named "Language" also set Allow varying by culture to true.
=> Templates
Master Layout:
Home template:
And in Content section for each homepage I added short language name.
As you mentioned in previous post that intlHomePage wolud be Models Builder name, in my case Home if I'm not mistaken -> after runing site I'm getting error that Home is not available in current context so I rename it to Model and it works.
Hi!
Great that you found your way around! =D
I came to think about a presentation that I made during the Swedish Umbraco Festival some months ago, you can download the slides here:
http://www.enkelmedia.se/blogg/2018/11/16/umbraco-sweden-festival-2018.aspx
There is an example in there as well.
Cheers!
What would I have to do if I wanted a combination of the language chooser on page level as well as on main language level? Let's say I'm on a page that doesn't have a German (or whatever) variant of that specific page, then I'd like to navigate to the German front page instead of directly to the German variant of the current page. How would I go about doing that?
I think in the backoffice you can set a fallback language/culture.
Thanks for the feedback Paul - however it's not working. I'm also not getting the correct links to the correct language version using the code above even if fallback language is selected or not.
Hi all.
How do you get this to work on localhost?
For anyone who has error issues with Umbraco 8.1.0 creating language switcher and particular code @Model.GetUrl(culture), here is the answer:
https://our.umbraco.com/forum/umbraco-8/98097-language-switcher-error-on-810
Hello Everyone!
I tried this code @foreach (var (culture, infos) in Model.Cultures) {
But @Model.Value("language", culture) is not working for me. It returns an empty string in every iteration. Any suggestions?
Thanks!
My menu looks like this:
This will automatically redirect to the current page in the language you clicked on.
Your solution will look something like this.
Here is what I did to make a language switcher that works on every page.
@home is a variable for the content at root
I have created a property called Language at the Document type of my home page and this will include the language texts I want to show (NL, FR,DE in my case)
is working on a reply...