Skip to content

Commit 77c5282

Browse files
committed
修复国际化问题 (#532)
1 parent 117c73f commit 77c5282

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace N_m3u8DL_RE.CommandLine;
1717

1818
internal static partial class CommandInvoker
1919
{
20-
public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20241201";
20+
public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20241202";
2121

2222
[GeneratedRegex("((best|worst)\\d*|all)")]
2323
private static partial Regex ForStrRegex();

src/N_m3u8DL-RE/Program.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using N_m3u8DL_RE.Parser.Config;
1+
using System.Globalization;
2+
using N_m3u8DL_RE.Parser.Config;
23
using N_m3u8DL_RE.Common.Entity;
34
using N_m3u8DL_RE.Common.Enum;
45
using N_m3u8DL_RE.Parser;
@@ -50,6 +51,17 @@ static async Task Main(string[] args)
5051

5152
ResString.CurrentLoc = loc;
5253

54+
try
55+
{
56+
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(loc);
57+
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(loc);
58+
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(loc);
59+
}
60+
catch
61+
{
62+
// Culture not work on NT6.0, so catch the exception
63+
}
64+
5365
await CommandInvoker.InvokeArgs(args, DoWorkAsync);
5466
}
5567

0 commit comments

Comments
 (0)