Skip to content

Commit

Permalink
Localise some of the text.
Browse files Browse the repository at this point in the history
  • Loading branch information
FirehawkV21 committed Oct 6, 2021
1 parent 25d9598 commit 548ff94
Show file tree
Hide file tree
Showing 7 changed files with 585 additions and 23 deletions.
41 changes: 18 additions & 23 deletions RMMVCookTool.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ private static void Main(string[] args)
if (args.Length >= 1)
{
Rule argsTab = new();
argsTab.Title = "[orange1]Command line arguments[/]";
argsTab.Title = Resources.CommandLineArgsTitle;
argsTab.Alignment = Justify.Left;
AnsiConsole.Write(argsTab);
Table argsTable = new();
argsTable.AddColumn("Setting");
argsTable.AddColumn("Value");
argsTable.AddColumn(Resources.SettingTitle);
argsTable.AddColumn(Resources.ValueTitle);
argsTable.Border = TableBorder.Rounded;
CompilerUtilities.RecordToLog("Command Line Arguments loaded. Processing...", 0);
for (int argnum = 0; argnum < args.Length; argnum++)
Expand All @@ -58,7 +58,7 @@ private static void Main(string[] args)
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "nwjc.exe" : "nwjc")))
{
CompilerUtilities.RecordToLog($"NW.js compiler found at {_sdkLocation}.", 0);
argsTable.AddRow("SDK Location", _sdkLocation);
argsTable.AddRow(Resources.SDKLocationEntry, _sdkLocation);
Console.ResetColor();
}
else
Expand All @@ -82,7 +82,7 @@ private static void Main(string[] args)
if (argnum <= args.Length - 1 && (Directory.Exists(newProject.Value.ProjectLocation) && File.Exists(Path.Combine(newProject.Value.ProjectLocation, "package.json"))))
{
CompilerUtilities.RecordToLog($"RPG Maker MV/MZ project found at {newProject.Value.ProjectLocation}.", 0);
argsTable.AddRow("Project Location", newProject.Value.ProjectLocation);
argsTable.AddRow(Resources.ProjectLocationEntry, newProject.Value.ProjectLocation);
Console.ResetColor();
}
else
Expand All @@ -105,7 +105,7 @@ private static void Main(string[] args)
{
newProject.Value.FileExtension = args[argnum + 1];
CompilerUtilities.RecordToLog($"File extension set to .{newProject.Value.FileExtension}.", 0);
argsTable.AddRow("File Extension", newProject.Value.FileExtension);
argsTable.AddRow(Resources.FileExtensionEntry, newProject.Value.FileExtension);
Console.ResetColor();
}
break;
Expand All @@ -132,7 +132,7 @@ private static void Main(string[] args)
if (argnum + 1 <= args.Length - 1)
{
_compressProject = args[argnum + 1] == "Final" ? 1 : 2;
argsTable.AddRow("Compression", ((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final") ? "Compress and remove" : "Compress only");
argsTable.AddRow(Resources.CompressionEntry, ((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final") ? Resources.CompressAndRemoveEntry : Resources.CompressOnlyEntry);
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final" ?
Resources.ProjectFilesRemovalAfterCompressionText :
Expand All @@ -143,7 +143,7 @@ private static void Main(string[] args)
else
{
CompilerUtilities.RecordToLog($"Only compression will occur.", 0);
argsTable.AddRow("Compression", "Compress only");
argsTable.AddRow(Resources.CompressionEntry, Resources.CompressOnlyEntry);
_compressProject = 2;
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine(Resources.ProjectFilesCompressionConfirmText);
Expand Down Expand Up @@ -183,7 +183,7 @@ private static void Main(string[] args)
else
{
CompilerUtilities.RecordToLog("Test mode is turned on.", 0);
argsTable.AddRow("Test after compiling", "Yes");
argsTable.AddRow(Resources.TestAfterCompilingEntry, Resources.CommonWordYes);
_testProject = true;
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine(Resources.nwjsTestStartingText);
Expand Down Expand Up @@ -224,17 +224,17 @@ private static void Main(string[] args)
if (_compressProject < 3) switch (newProject.Value.CompressionModeLevel)
{
case 2:
argsTable.AddRow("Compression Level", "No compression");
argsTable.AddRow(Resources.CompressionLevelEntry, Resources.NoCompression);
break;
case 1:
argsTable.AddRow("Compression Level", "Fastest");
argsTable.AddRow(Resources.CompressionLevelEntry, Resources.FastestCompression);
break;
case 0:
argsTable.AddRow("Compression Level", "Optimal");
argsTable.AddRow(Resources.CompressionLevelEntry, Resources.OptimalCompression);
break;
}
if (_checkDeletion == 2) argsTable.AddRow("Remove source files", "Yes");
else argsTable.AddRow("Remove source files", "No");
if (_checkDeletion == 2) argsTable.AddRow(Resources.RemoveSourceFilesEntry, Resources.CommonWordYes);
else argsTable.AddRow(Resources.RemoveSourceFilesEntry, Resources.CommonWordNo);
#endregion
#region Workload Check
//Check if both the _projectLocation and _sdkLocation variables are not null.
Expand Down Expand Up @@ -270,7 +270,7 @@ private static void Main(string[] args)
if (!_settingsSet)
{
Rule setupTab = new();
setupTab.Title = "[orange1]Setup[/]";
setupTab.Title = RMMVCookTool.CLI.Properties.Resources.SetupTitle;
setupTab.Alignment = Justify.Left;
AnsiConsole.Write(setupTab);
do
Expand Down Expand Up @@ -336,7 +336,7 @@ private static void Main(string[] args)

#region Workload Code
Rule workTab = new();
workTab.Title = "[orange1]Work[/]";
workTab.Title = Resources.WorkTitle;
workTab.Alignment = Justify.Left;
AnsiConsole.Write(workTab);
//Find the game folder.
Expand Down Expand Up @@ -379,7 +379,7 @@ private static void Main(string[] args)
AnsiConsole.Progress()
.Start(progress =>
{
var compilerTask = progress.AddTask("[darkcyan]Compiling JS files[/]");
var compilerTask = progress.AddTask(RMMVCookTool.CLI.Properties.Resources.DarkcyanCompilingJSFilesText);
compilerTask.MaxValue = 131;
while (!progress.IsFinished)
{
Expand All @@ -397,19 +397,14 @@ private static void Main(string[] args)
timer.Stop();
CompilerUtilities.RecordToLog($"Completed the compilation. (Time elapsed:{timer.Elapsed}/Total Time (so far):{totalTime.Elapsed}", 0);
timer.Reset();
Console.ForegroundColor = ConsoleColor.DarkCyan;
Console.Write(Resources.DateTimeFormatText, DateTime.Now);
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine(Resources.CompilerTaskComplete);
Console.ResetColor();
if (_testProject)
{
Console.WriteLine(Resources.NwjsStartingTestNotificationText);
newProject.Value.RunTest(_sdkLocation);
}
else if (_compressProject < 3 && _checkDeletion == 2)
{
CompilerUtilities.RecordToLog("Packaging the game...", 0);
CompilerUtilities.RecordToLog(Resources.PackagingGameText, 0);
timer.Start();
AnsiConsole.Status()
.Start(Resources.FileCompressionText, spin =>
Expand Down
Loading

0 comments on commit 548ff94

Please sign in to comment.