Intermittent incorrect culture language on page load

Luke Hook asked on May 11, 2018 11:50

Hi there,

We have a website that runs primarily on a '.co.uk' domain. We also have an Irish version of the site that sits under the domain alias '.ie' - periodically on page load the culture doesn't match the domain. For instance, quite often when loading the .ie version of the site we can see in the code that the culture is coming in as 'en-GB' which is incorrect. This is inconsistent behaviour and there seems to be no pattern to it replicating it.

Applying the Force domain culture setting seems to prevent the issue HOWEVER when we do so the website redirects any pages that don't have translated versions rather than 'combining the default culture content'.

How can we resolve this issue so that the culture is strictly maintained by domain (en_GB on .co.uk and en_IE on .ie) as well as to inherit the content from the default culture where pages aren't translated.

Thanks in advance, Luke

Correct Answer

Juraj Ondrus answered on May 29, 2018 10:16

Hi,
You want to have combination of two thigs which do not go along together. You either want to combine the culture with the defaul culture for not translated pages - so this way the culture is changed to the default culture so the system can properly serve the content. Or, you want to have the culture based on the domain - soo this is the flag telling what culture to server - so you need to ensure that those pages are translated. So yes, you will need to use custom request event handler and check the culture, check for existing pages and then serve desired content. This can be pretty resource consuming - so the performance and load times may decrease.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on May 11, 2018 16:28

When you perform your testing, is it in a private browser window when you are not logged into the CMS?

0 votesVote for this answer Mark as a Correct answer

Luke Hook answered on May 11, 2018 16:36 (last edited on May 11, 2018 17:29)

We have done fairly extensive testing using new sessions and in private browsing across multiple devices and browsers. There seems to be no pattern to the issue at all as it is totally intermittent in nature.

And also not logged in to the CMS at the time in addition to the above

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 14, 2018 14:02

Could you please describe all your culture settings - what is the visitor and default content culture set for the site. What is set as default cultre in Settings -> Content and also what are the settings in URLs and SEO section?
Are you using any caching? If yes, what are the caching variables? Are you also caching items per domain?
There are many combinations of the settings but the "Force domain culture" was made exactly for what you need. So, it may end up with a decision - whether you want to have the culture set strictly per domain or whether you want to combine not translated pages with default culture. Otherwsie, come custom code will be required to handle the requests.

0 votesVote for this answer Mark as a Correct answer

Luke Hook answered on May 29, 2018 10:10

Hi there,

Our 'Default Content Culture' setting is set to 'English - United Kingdom' with both 'Combine with default culture' and 'Combine files with default culture' options checked.

In SEO & URL's we don't currently have the 'Force domain culture' setting checked but the issue is resolved when we do check it. The problem then being, as you say, that we still require a combination of Translated pages with default culture. So when the .ie domain is hit. We want to serve the translated (Irish) pages where they exist and the UK (default) ones where they do not. Is this functionality what you are describing as needing custom code?

If so do you have any guidance as to what coding would be required?

Thanks, Luke

0 votesVote for this answer Mark as a Correct answer

Luke Hook answered on May 29, 2018 10:19

Ok that's useful thank you. Is there a way to quickly or easily 'duplicate' all the items in the content tree to a translated culture? As the majority of the Irish pages server English content we just need to duplicate all the pages in to the Irish Translation. Is there a quick / programmatical way to do this?

Thanks so much for your quick response

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 29, 2018 10:23

Yes, you can use the API examples and create new culture version of the pages or, in the Admin UI, when you switch to the Listing mode - you can select given child pages and then in the mass actions translate them to desired culture - EMS license is needed in this case.

0 votesVote for this answer Mark as a Correct answer

Luke Hook answered on May 29, 2018 10:28

Thank you that's really useful. I am having another issue viewing our translated content however. Whenever I select our other culture (Irish content) every item in the tree returns an error page (custom 500) in the preview/edit pane. The event log is throwing this error.

Unknown server tag 'cms:TranslationPriority

I'm not sure how to rectify this?

0 votesVote for this answer Mark as a Correct answer

Luke Hook answered on May 29, 2018 11:08

Please ignore the above we found the solution that was caused as a result of the Kentico Upgrade

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.