Question

I'm using the CurrentUICulture for Localization. This works pretty well until the UI Culture is queried in a different Thread. So my question is how to fix the CurrentUICulture so that it is fix also when I create a new thread.

Currently I'm setting Thread.CurrentThread.CurrentUICulture in the very first line the application starts.

Thanks

Was it helpful?

Solution

The CurrentUICulture is only relevant for loading resources and so it should normally only matter to the GUI thread.

When you need it on another thread (I assume to load StringTable resources) then that might be a sign that something is wrong with your main architecture. It shouldn't normally happen.

But if you really need it, it should be possible with a few static variable to hold your CultureInfo and/or resource block.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top