From 6d4e6b5100ca2ead80a04b4be8be56c909ed6678 Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Thu, 18 Jan 2024 21:38:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet.ModMaker/Models/ModLoader.cs | 42 +++++++++++++------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/VPet.ModMaker/Models/ModLoader.cs b/VPet.ModMaker/Models/ModLoader.cs index 2525c94..92a1a34 100644 --- a/VPet.ModMaker/Models/ModLoader.cs +++ b/VPet.ModMaker/Models/ModLoader.cs @@ -1,6 +1,7 @@ using LinePutScript; using LinePutScript.Converter; using LinePutScript.Dictionary; +using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; using System.IO; @@ -213,30 +214,23 @@ public class ModLoader case "lang": Tag.Add("lang"); langDirectory = di; - //foreach (FileInfo fi in di.EnumerateFiles("*.lps")) - //{ - // //LocalizeCore.AddCulture( - // // fi.Id.Substring(0, fi.Id.Length - fi.Extension.Length), - // // new LPS_D(File.ReadAllText(fi.FullName)) - // //); - //} - //foreach (DirectoryInfo dis in di.EnumerateDirectories()) - //{ - // foreach (FileInfo fi in dis.EnumerateFiles("*.lps")) - // { - // //LocalizeCore.AddCulture( - // // dis.Id, - // // new LPS_D(File.ReadAllText(fi.FullName)) - // //); - // } - //} - - //if (mw.Set.Language == "null") - //{ - // LocalizeCore.LoadDefaultCulture(); - //} - //else - // LocalizeCore.LoadCulture(mw.Set.Language); + foreach (FileInfo fi in di.EnumerateFiles("*.lps")) + { + LocalizeCore.AddCulture( + Path.GetFileNameWithoutExtension(fi.Name), + new LPS_D(File.ReadAllText(fi.FullName)) + ); + } + foreach (DirectoryInfo dis in di.EnumerateDirectories()) + { + foreach (FileInfo fi in dis.EnumerateFiles("*.lps")) + { + LocalizeCore.AddCulture( + dis.Name, + new LPS_D(File.ReadAllText(fi.FullName)) + ); + } + } break; } } From 1b1f52d912bae53e1693590fab0c88ed40112bcf Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Sat, 20 Jan 2024 16:50:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=B8=AD=E7=8A=B6=E6=80=81=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF[#314](https://github.com/LorisYounger/VPet/i?= =?UTF-8?q?ssues/314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet.ModMaker/Views/ModEdit/MoveEdit/MoveEditWindow.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VPet.ModMaker/Views/ModEdit/MoveEdit/MoveEditWindow.xaml b/VPet.ModMaker/Views/ModEdit/MoveEdit/MoveEditWindow.xaml index 2991333..ae947ee 100644 --- a/VPet.ModMaker/Views/ModEdit/MoveEdit/MoveEditWindow.xaml +++ b/VPet.ModMaker/Views/ModEdit/MoveEdit/MoveEditWindow.xaml @@ -168,7 +168,7 @@