Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d499a9b

Browse files
committed
Making error messages less difficult to localize
1 parent e7047c9 commit d499a9b

File tree

12 files changed

+124
-26
lines changed

12 files changed

+124
-26
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
This file is part of Module Manager Watch Dog
3+
©2020-2023 Lisias T : http://lisias.net <support@lisias.net>
4+
5+
Module Manager Watch Dog is licensed as follows:
6+
* SKL 1.0 : https://ksp.lisias.net/SKL-1_0.txt
7+
8+
Module Manager Watchdog is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
12+
You should have received a copy of the SKL Standard License 1.0
13+
along with Module Manager Watch Dog. If not, see
14+
<https://ksp.lisias.net/SKL-1_0.txt>.
15+
16+
*/
17+
namespace ModuleManagerWatchDog
18+
{
19+
internal static class ErrorMessage
20+
{
21+
public static readonly string ERR_MMWD_DUPLICATED = "There're more than one MM Watch Dog on this KSP installment! Please delete all but the one you intend to use!";
22+
public static readonly string ERR_MMWD_WRONGPLACE = "666_ModuleManagerWatchDog.dll <b>must be</b> directly on GameData and not inside any subfolder (i.e., it must be in the same place ModuleManager.dll is). Please move 666_ModuleManagerWatchDog.dll directly into GameData.";
23+
public static readonly string ERR_MM_ABSENT = "There's no Module Manager on this KSP installment! You need to install Module Manager!";
24+
public static readonly string ERR_MM_WRONGPLACE = "ModuleManager.dll <b>must be</b> directly on GameData and not inside any subfolder. Please move ModuleManager.dll directly into GameData.";
25+
public static readonly string ERR_MM_DOPPELGANGER = "There're more than one Module Manager on this KSP installment! Please delete all but the one you intend to use!";
26+
public static readonly string ERR_MM_CONFLICT = "There're conflicting Module Manager versions on your instalment! You need to choose one version and remove the other(s)!";
27+
public static readonly string ERR_MM_FORUMDELETED = "You had selected MM/L as preffered Module Manager, but somehow other forks were installed and were automatically removed.";
28+
}
29+
}

‎Source/ModuleManagerWatchDog/ModuleManagerWatchDog.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<Compile Include="Util\SanityLib.cs" />
5353
<Compile Include="Properties\LegalMamboJambo.cs" />
5454
<Compile Include="Globals.cs" />
55+
<Compile Include="ErrorMessages.cs" />
5556
</ItemGroup>
5657
<ItemGroup>
5758
<None Include="Properties\Version.tt">

‎Source/ModuleManagerWatchDog/Startup.cs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ private string CheckMyself()
7070
#endif
7171

7272
// Obviously, would be pointless to check for it not being installed! (0 == count). :)
73-
if (1 != loaded.Count()) return "There're more than one MM Watch Dog on this KSP installment! Please delete all but the one you intend to use!";
73+
if (1 != loaded.Count()) return ErrorMessage.ERR_MMWD_DUPLICATED;
7474
if (!SanityLib.CheckIsOnGameData(loaded.First().path))
75-
return "666_ModuleManagerWatchDog.dll <b>must be</b> directly on GameData and not inside any subfolder (i.e., it must be in the same place ModuleManager.dll is). Please move 666_ModuleManagerWatchDog.dll directly into GameData.";
75+
return ErrorMessage.ERR_MMWD_WRONGPLACE;
7676
return null;
7777
}
7878

@@ -86,9 +86,9 @@ private string CheckModuleManager()
8686
Log.dbg("{0} :: {1}", la.assembly.FullName, la.assembly.Location);
8787
#endif
8888

89-
if (0 == loaded.Count()) return "There's no Module Manager on this KSP installment! You need to install Module Manager!";
89+
if (0 == loaded.Count()) return ErrorMessage.ERR_MM_ABSENT;
9090
if (!SanityLib.CheckIsOnGameData(loaded.First().path))
91-
return "ModuleManager.dll <b>must be</b> directly on GameData and not inside any subfolder. Please move ModuleManager.dll directly into GameData.";
91+
return ErrorMessage.ERR_MM_WRONGPLACE;
9292
return null;
9393
}
9494

@@ -102,7 +102,7 @@ private string CheckModuleManagerDoppelganger18()
102102
foreach (System.Reflection.Assembly a in loaded)
103103
Log.dbg("{0} :: {1}", a.FullName, a.Location);
104104
#endif
105-
if (1 != loaded.Count()) return "There're more than one Module Manager on this KSP installment! Please delete all but the one you intend to use!";
105+
if (1 != loaded.Count()) return ErrorMessage.ERR_MM_DOPPELGANGER;
106106
return null;
107107
}
108108

@@ -135,7 +135,7 @@ private string CheckModuleManagerConflict112()
135135
||
136136
(assembly.Location.EndsWith(DASHMMDLL) && !assemblyTittle.StartsWith("Module Manager /L"))
137137
)
138-
return "There're conflicting Module Manager versions on your instalment! You need to choose one version and remove the other(s)!";
138+
return ErrorMessage.ERR_MM_CONFLICT;
139139
return null;
140140
}
141141

@@ -157,7 +157,7 @@ private string CheckModuleManagerDoppelganger112()
157157
foreach (AssemblyLoader.LoadedAssembly m in AssemblyLoader.loadedAssemblies)
158158
if (ASSEMBLY_NAME.Equals(m.assembly.GetName().Name)) ++hits;
159159

160-
if (hits > 1) return "There're more than one Module Manager on this KSP installment! Please delete all but the one you intend to use!";
160+
if (hits > 1) return ErrorMessage.ERR_MM_DOPPELGANGER;
161161
return null;
162162
}
163163

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
This file is part of Watch Dog for Intestellar Redist, a component from Module Manager Watch Dog
3+
©2020-2023 Lisias T : http://lisias.net <support@lisias.net>
4+
5+
Module Manager Watch Dog is licensed as follows:
6+
* SKL 1.0 : https://ksp.lisias.net/SKL-1_0.txt
7+
8+
Module Manager Watchdog is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
12+
You should have received a copy of the SKL Standard License 1.0
13+
along with Module Manager Watch Dog. If not, see
14+
<https://ksp.lisias.net/SKL-1_0.txt>.
15+
16+
*/
17+
namespace WatchDogForInterstellarRedist
18+
{
19+
public static class ErrorMessage
20+
{
21+
public static readonly string ERR_MULTIPLE_TOOL = "There're more than one Interstellar Redist Watch Dog on this KSP installment! Please delete all but the one on GameData/ModuleManagerWatchDog/Plugins !";
22+
public static readonly string ERR_MISSING_DLL = "There's no Interstellar Redist dll on this KSP installment, besides you having installed known DLL(s) that need it!!";
23+
public static readonly string ERR_MULTIPLE_DLL = "There're more than one Interstellar Redist dll on this KSP installment! Please delete all but the GameData/Interstellar_Redist.dll one!";
24+
public static readonly string ERR_MISPLACED_DLL = "Interstellar Redist dll <b>must be</b> directly on GameData and not inside any subfolder. Please move Interstellar_Redist.dll directly into GameData.";
25+
}
26+
}

‎Source/WatchDogForInterstellarRedist/Startup.cs‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,13 @@ private void Start()
6565

6666
private const string ASSEMBLY_NAME = "Interstellar_Redist";
6767
private const string DLL_FILENAME = "Interstellar_Redist.dll";
68-
private const string ERR_MULTIPLE_TOOL = "There're more than one Interstellar Redist Watch Dog on this KSP installment! Please delete all but the one on GameData/ModuleManagerWatchDog/Plugins !";
69-
private const string ERR_MISSING_DLL = "There's no Interstellar Redist dll on this KSP installment, besides you having installed known DLL(s) that need it!!";
70-
private const string ERR_MULTIPLE_DLL = "There're more than one Interstellar Redist dll on this KSP installment! Please delete all but the GameData/Interstellar_Redist.dll one!";
71-
private const string ERR_MISPLACED_DLL = "Interstellar Redist dll <b>must be</b> directly on GameData and not inside any subfolder. Please move Interstellar_Redist.dll directly into GameData.";
7268

7369
private string CheckMyself()
7470
{
7571
IEnumerable<AssemblyLoader.LoadedAssembly> loaded = SanityLib.FetchLoadedAssembliesByName(this.GetType().Namespace);
7672

7773
// Obviously, would be pointless to check for it not being installed! (0 == count). :)
78-
if (1 != loaded.Count()) return ERR_MULTIPLE_TOOL;
74+
if (1 != loaded.Count()) return ErrorMessage.ERR_MULTIPLE_TOOL;
7975
return null;
8076
}
8177

@@ -92,7 +88,7 @@ private bool IsNeeded()
9288
private string CheckRedist()
9389
{
9490
IEnumerable<AssemblyLoader.LoadedAssembly> loaded = SanityLib.FetchLoadedAssembliesByName(ASSEMBLY_NAME);
95-
if (0 == loaded.Count()) return ERR_MISSING_DLL;
91+
if (0 == loaded.Count()) return ErrorMessage.ERR_MISSING_DLL;
9692
return null;
9793
}
9894

@@ -103,9 +99,9 @@ private string CheckRedist18()
10399
{
104100
IEnumerable<AssemblyLoader.LoadedAssembly> loaded = SanityLib.FetchLoadedAssembliesByName(ASSEMBLY_NAME);
105101

106-
if (1 != loaded.Count()) return ERR_MULTIPLE_DLL;
102+
if (1 != loaded.Count()) return ErrorMessage.ERR_MULTIPLE_DLL;
107103
if (!SanityLib.CheckIsOnGameData(loaded.First().path, DLL_FILENAME))
108-
return ERR_MISPLACED_DLL;
104+
return ErrorMessage.ERR_MISPLACED_DLL;
109105
return null;
110106
}
111107
}

‎Source/WatchDogForInterstellarRedist/WatchDogForInterstellarRedist.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<Compile Include="Util\Log.cs" />
4444
<Compile Include="Startup.cs" />
4545
<Compile Include="GUI\ShowStopperAlertBox.cs" />
46+
<Compile Include="ErrorMessages.cs" />
4647
</ItemGroup>
4748
<ItemGroup>
4849
<Folder Include="Util\" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
This file is part of Watch Dog for Scale Redist, a component from Module Manager Watch Dog
3+
©2020-2023 Lisias T : http://lisias.net <support@lisias.net>
4+
5+
Module Manager Watch Dog is licensed as follows:
6+
* SKL 1.0 : https://ksp.lisias.net/SKL-1_0.txt
7+
8+
Module Manager Watchdog is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
12+
You should have received a copy of the SKL Standard License 1.0
13+
along with Module Manager Watch Dog. If not, see
14+
<https://ksp.lisias.net/SKL-1_0.txt>.
15+
16+
*/
17+
namespace WatchDogForScaleRedist
18+
{
19+
public static class ErrorMessage
20+
{
21+
public static readonly string ERR_MULTIPLE_TOOL = "There're more than one Scale Redist Watch Dog on this KSP installment! Please delete all but the one on GameData/ModuleManagerWatchDog/Plugins !";
22+
public static readonly string ERR_MISSING_DLL = "There's no Scale Redist dll on this KSP installment, besides you having installed known DLL(s) that need it!!";
23+
public static readonly string ERR_MULTIPLE_DLL = "There're more than one Scale Redist dll on this KSP installment! Please delete all but the GameData/999_Scale_Redist.dll one!";
24+
public static readonly string ERR_MISPLACED_DLL = "Scale Redist dll <b>must be</b> directly on GameData (and not inside any subfolder) and <b>should</b> be named 999_Scale_Redist.dll . Please move 999_Scale_Redist.dll directly into GameData.";
25+
}
26+
}

‎Source/WatchDogForScaleRedist/Startup.cs‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,13 @@ private void Execute()
8282

8383
private const string ASSEMBLY_NAME = "Scale_Redist";
8484
private const string DLL_FILENAME = "999_Scale_Redist.dll";
85-
private const string ERR_MULTIPLE_TOOL = "There're more than one Scale Redist Watch Dog on this KSP installment! Please delete all but the one on GameData/ModuleManagerWatchDog/Plugins !";
86-
private const string ERR_MISSING_DLL = "There's no Scale Redist dll on this KSP installment, besides you having installed known DLL(s) that need it!!";
87-
private const string ERR_MULTIPLE_DLL = "There're more than one Scale Redist dll on this KSP installment! Please delete all but the GameData/999_Scale_Redist.dll one!";
88-
private const string ERR_MISPLACED_DLL = "Scale Redist dll <b>must be</b> directly on GameData (and not inside any subfolder) and <b>should</b> be named 999_Scale_Redist.dll . Please move 999_Scale_Redist.dll directly into GameData.";
8985

9086
private string CheckMyself()
9187
{
9288
IEnumerable<AssemblyLoader.LoadedAssembly> loaded = SanityLib.FetchLoadedAssembliesByName(this.GetType().Namespace);
9389

9490
// Obviously, would be pointless to check for it not being installed! (0 == count). :)
95-
if (1 != loaded.Count()) return ERR_MULTIPLE_TOOL;
91+
if (1 != loaded.Count()) return ErrorMessage.ERR_MULTIPLE_TOOL;
9692
return null;
9793
}
9894

@@ -109,7 +105,7 @@ private bool IsNeeded()
109105
private string CheckRedist()
110106
{
111107
IEnumerable<AssemblyLoader.LoadedAssembly> loaded = SanityLib.FetchLoadedAssembliesByName(ASSEMBLY_NAME);
112-
if (0 == loaded.Count()) return ERR_MISSING_DLL;
108+
if (0 == loaded.Count()) return ErrorMessage.ERR_MISSING_DLL;
113109
return null;
114110
}
115111

@@ -120,9 +116,9 @@ private string CheckRedist18()
120116
{
121117
IEnumerable<AssemblyLoader.LoadedAssembly> loaded = SanityLib.FetchLoadedAssembliesByName(ASSEMBLY_NAME);
122118

123-
if (1 != loaded.Count()) return ERR_MULTIPLE_DLL;
119+
if (1 != loaded.Count()) return ErrorMessage.ERR_MULTIPLE_DLL;
124120
if (!SanityLib.CheckIsOnGameData(loaded.First().path, DLL_FILENAME))
125-
return ERR_MISPLACED_DLL;
121+
return ErrorMessage.ERR_MISPLACED_DLL;
126122
return null;
127123
}
128124
}

‎Source/WatchDogForScaleRedist/WatchDogForScaleRedist.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<Compile Include="GUI\ShowStopperAlertBox.cs" />
4444
<Compile Include="Startup.cs" />
4545
<Compile Include="Util\Log.cs" />
46+
<Compile Include="ErrorMessages.cs" />
4647
</ItemGroup>
4748
<ItemGroup>
4849
<ProjectReference Include="..\ModuleManagerWatchDog\ModuleManagerWatchDog.csproj">
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
This file is part of WatchDog.InstallChecker, a component for Module Manager Watch Dog
3+
©2020-2023 LisiasT : http://lisias.net <support@lisias.net>
4+
5+
KSP Enhanced /L is licensed as follows:
6+
* SKL 1.0 : https://ksp.lisias.net/SKL-1_0.txt
7+
8+
Module Manager Watchdog is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
12+
You should have received a copy of the SKL Standard License 1.0
13+
along with Module Manager Watch Dog. If not, see
14+
<https://ksp.lisias.net/SKL-1_0.txt>.
15+
16+
*/
17+
namespace WatchDog.InstallChecker
18+
{
19+
public static class ErrorMessage
20+
{
21+
public static readonly string ERR_MULTIPLE_TOOL = "There're more than one WatchDog Install Checker on this KSP installment! Please delete all but the one on GameData/ModuleManagerWatchDog/Plugins !";
22+
}
23+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /