Skip to content

Commit

Permalink
修复国际化问题 (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda committed Dec 1, 2024
1 parent 117c73f commit 49d37c9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/N_m3u8DL-RE/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using N_m3u8DL_RE.Parser.Config;
using System.Globalization;
using N_m3u8DL_RE.Parser.Config;
using N_m3u8DL_RE.Common.Entity;
using N_m3u8DL_RE.Common.Enum;
using N_m3u8DL_RE.Parser;
Expand Down Expand Up @@ -50,6 +51,17 @@ static async Task Main(string[] args)

ResString.CurrentLoc = loc;

try
{
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(loc);
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(loc);
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(loc);
}
catch
{
// Culture not work on NT6.0, so catch the exception
}

await CommandInvoker.InvokeArgs(args, DoWorkAsync);
}

Expand Down

0 comments on commit 49d37c9

Please sign in to comment.