Skip to content

Commit de0d0c1

Browse files
committed
enhance: it's not necessary to change thread's culture
1 parent cc0a223 commit de0d0c1

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/App.axaml.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
4-
using System.Globalization;
54
using System.IO;
65
using System.Net.Http;
76
using System.Reflection;
@@ -195,17 +194,6 @@ app.Resources[localeKey] is not ResourceDictionary targetLocale ||
195194
if (app._activeLocale != null)
196195
app.Resources.MergedDictionaries.Remove(app._activeLocale);
197196

198-
try
199-
{
200-
var culture = CultureInfo.GetCultureInfo(localeKey.Replace("_", "-"));
201-
Thread.CurrentThread.CurrentUICulture = culture;
202-
Thread.CurrentThread.CurrentCulture = culture;
203-
}
204-
catch
205-
{
206-
// Just ignore
207-
}
208-
209197
app.Resources.MergedDictionaries.Add(targetLocale);
210198
app._activeLocale = targetLocale;
211199
}

0 commit comments

Comments
 (0)