修复国际化问题 (#532)

This commit is contained in:
nilaoda 2024-12-01 11:33:41 +08:00
parent 117c73f54b
commit 49d37c9f14
1 changed files with 13 additions and 1 deletions

View File

@ -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.Entity;
using N_m3u8DL_RE.Common.Enum; using N_m3u8DL_RE.Common.Enum;
using N_m3u8DL_RE.Parser; using N_m3u8DL_RE.Parser;
@ -50,6 +51,17 @@ internal class Program
ResString.CurrentLoc = loc; 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); await CommandInvoker.InvokeArgs(args, DoWorkAsync);
} }