Set CultureInfo.CurrentCulture sets also CurrentUICulture and vice versa

210 views Asked by At

For some reason, when setting in my app CultureInfo.CurrentCulture to 'de-CH', it automatically sets CultureInfo.CurrentUICulture to 'de-CH' too. If I do it the inverse way, it is happenning too. My system is in 'en-US'

    private void SetCurrentCultures(CultureInfo cultureInfo, CultureInfo cultureUiInfo)
    {
        CultureInfo.CurrentCulture = cultureInfo;
        CultureInfo.CurrentUICulture = cultureUiInfo;

        Thread.CurrentThread.CurrentCulture = cultureInfo;
        Thread.CurrentThread.CurrentUICulture = cultureUiInfo;
    }

enter image description here

As you can see in the image, I set 'de-CH' to CurrentCulture and it sets CurrentUICulture too. After I set 'fr' to CurrentUICulture, it sets CurrentCulture to 'fr' too.

Does anyone know if this is a bug from Xamarin Forms, .NET or am I doing anything wrong?

UPDATE:

The problem is happening on a UWP app too, so it's not a XF issue.

0

There are 0 answers