Hello,
we have the requirement to separate language and culture. ex. English language but Hungarian datetime and number format.
Dotnet uses Thread.CurrentThread.CurrentUICulture and Thread.CurrentThread.CurrentCulture.
We found that Wisej only supports a single culture using Application.CurrentCulture setting CurrentUICulture and CurrentCulture.
Any plans to implement CurrentUICulture as own property within Application?
best regards
Bernhard
Hi Luca,
I created a sample program.
best regards
Bernhard
Hello Luca,
We already tried this and is is is not working. If we set Application.CurrentCulture and read it back we still get the old instance back.
static void Main() { var enHU = new CultureInfo("en-HU"); var huHU = CultureInfo.GetCultureInfo("hu-HU"); enHU.NumberFormat = huHU.NumberFormat; enHU.DateTimeFormat = huHU.DateTimeFormat; Application.CurrentCulture = enHU; if (Application.CurrentCulture == huHU) { MessageBox.Show("nothing changed"); } Application.MainPage = new Page1(); }
Snippet
static void Main() { var enHU = new CultureInfo("en-HU"); var huHU = CultureInfo.GetCultureInfo("hu-HU"); enHU.NumberFormat = huHU.NumberFormat; enHU.DateTimeFormat = huHU.DateTimeFormat; Application.CurrentCulture = enHU; Application.MainPage = new Page1(); }
Works well. It’s not a workaround, a culture with english language and hungarian formatting is a custom one by definition.
If you need a custom solution change request, please send the request through the TP channel.
Hi Alaa,
thank you for you response but CultureAndRegionInfoBuilder is not supported in .net core.
We also tried to clone CultureInfo and set all the format related properties like NumberFormat but WiseJ ignores this when setting Application.CurrentCulture and stays the old value. Even if it would work I would also count this as a work around.
In the dotnet world the UICulture and Culture are very important for any international company.
I understand that this might be a breaking change for WiseJ. Would this possible for WiseJ 4?
best regards
Bernhard
Hi Bernhard,
It’s best to create your own Culture.
You can check out the MSDN Documentation on how to create your own Culture!
The UI and Culture thread aren’t necessary for what you’re trying to do!
HTH,
Alaa
Please login first to submit.