Skip to content

Commit 4f58559

Browse files
committed
Replace new() with CultureInfo.GetCultureInfo
1 parent 0b8f421 commit 4f58559

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

IPConfig/Languages/LangSource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public CultureInfo CurrentCulture
5555

5656
public static List<CultureInfo> GetAvailableCultures()
5757
{
58-
var result = new List<CultureInfo>() { new("zh-CN") };
58+
var result = new List<CultureInfo>() { CultureInfo.GetCultureInfo("zh-CN") };
5959

6060
var rm = new ResourceManager(typeof(Lang));
6161

@@ -94,7 +94,7 @@ public void SetLanguage(string locale)
9494
return;
9595
}
9696

97-
CultureInfo newCulture = new(locale);
97+
var newCulture = CultureInfo.GetCultureInfo(locale);
9898
Lang.Culture = newCulture;
9999
CurrentCulture = newCulture;
100100
HcLang.Culture = newCulture;

0 commit comments

Comments
 (0)