Detect language via browser's language preference

Vote:
 

I'm a little confused about this functionality (Detect language via browser's language preference). I have  a page with several languages, fallback lanugages set. On the start page thare are some languages that aren't "Available Languages" but still exists on some other parts on the site. If I come to the start page from one of theese countries I get the error message "Incorrect link". Shouldn't one of the fallback languages been selected instead? 

As I understand it, if I come to the page from a country that doesn't exist at all on the site the fallback languages kick in. Am I wrong here?

#75094
Sep 17, 2013 16:00
Vote:
 

Hello community!

I also interested in this question. Could you tell us about your options to solve this issue.

The solution in which we track the user's language and redirect his to the default language appears prohibitively expensive.

#76185
Oct 18, 2013 15:24
Vote:
 

I guess that this might depend on how your URL:s are set up. If you have the same URL between several language, for instance company.com, and detect language on some custom value (session state or whatever) browser language will be used if nothing specific is set. If you have language mappings for your language, this has higher priority than the browser setting which means that the browser setting will be ignored. Check the SDK for more information about the priority order:

http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/7/Globalization/Handling-Languages/#content

#76191
Oct 18, 2013 16:11
Vote:
 

Thanks for the description of priorities. But I'm worried about another issue. I have a website set up in two languages, English and French. In Admin mode also added other languages. Now I go to the site via a link or from my browser language settings with third language. let this Russian language. I want to see at this site is in English because it is the first on the list of priorities (in Admin mode), but I see the message: Incorrect link.

I need to set the default language so that it works not only in the case of fallback, but also when there is no translation at all.

#76209
Edited, Oct 20, 2013 21:57
Vote:
 

Selecting the actual language is a two way process.

  1. First the users preferred language is determined using the process described in the globalization documentation.
  2. Secondly, the content for each item is loaded given the language determined in step 1. If the current language is not available fallback language rules might take place to see if there are settings that enable to show content in other languages.

The first case will usually be decided by the URL which usually contains a language part. If this is not present, for instance when loading the start page without any language information, other things, like the order of the enabled languages might come into place.

It sounds to me like you should enable language fallback RU => EN for the start page of your site and then all pages not available in russioan should be shown in english.

#76210
Oct 21, 2013 7:11
Vote:
 

Thanks for the solution of the issue. I did not want to customize Fallback for all languages but probably should ☺

#76211
Oct 21, 2013 7:23
Vote:
 

Thanks for the answer Linus! Will try it out and return :) Thanks Sergey for keeping this post alive!

#76212
Oct 21, 2013 7:45
Vote:
 

Good answer, I love the langugage handling in EPi.

But I think we have a bug/feature. If a page is enabled on the site but not active for the home node, you can't set fallback languages and therefor it will give an incorrect link, even though it shouldn't (in my opinion) be necessary to set fallback languages for inactive languages. It should just render the primare language version of the site.

#77821
Nov 26, 2013 16:33
Vote:
 

Andreas: If I understand you correctly the current behavior is actually by design (it was actually working the way you describe it before but that was considered as a bug and was fixed). The reason for this is that you want to explicitly say when there should be content visible that has been written in another language. For some sites, getting language fallback to the original content might be valid but given a site with lots of languages that are not closely related to each other will probably yield unwanted behavior for visitors.

There is another language setting that we have been discussing that might want what you actually want. That is the posibility to enable master language fallback (that is, the language that the content was created with) for a part of the content tree. That might be usefull when you have a branch where you only want to create content in one language but have it visible for all other language. This would basically be the same as fallback but easier to set up since you don't need to set up a specific fallback setting for each language.

#77825
Nov 26, 2013 20:27
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.