Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • bh 230 posts 824 karma points
    May 29, 2019 @ 19:03

    How to Change my CurrentUICulture

    I'm working with the Vorto package on v7.4.4 and so far so good. I'm ready to test, and view the multilingual output on the front-end. But, I can't seem to change my @System.Threading.Thread.CurrentThread.CurrentUICulture.Name.ToString() Specifically I need to test for Spanish (United States). I'm on a Windows 10 machine running Chrome.
    I've added the Spanish (United States) language to my local machine. I've tried changing my location, and my "language for non-unicode programs", and the default language in Chrome.

    I have a webpage setup to display my CurrentUICulture.Name value and all I can get it show me is "en-US". I know I can change it programmatically at runtime using System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("es-US"); but I need to test getting it from the user's culture settings.

    Anyone know the trick to changing my CurrentUICulture?

  • Markus Johansson 1643 posts 4628 karma points c-trib
    May 29, 2019 @ 20:58
    Markus Johansson


    What culture do you have connected to the root node host name of your website?

    It was some time ago I played with this but as far as I remember the culture that was set on the root node was used throughout the site, web.config settings did not impact - but maybe it was possible to override the culture in some page load event.

    I guess your are expecting the culture to change based on the browser settings? I’m not sure but I don’t think that this is the default behavior for Umbraco and certainly not good for SEO since in these cases you would want each language to have a unique url.

Please Sign in or register to post replies

Write your reply to: