[DISKPART] Clean up the help system and fix translations

@Translators: You can translate text again, but please do no translate placeholder text.
This commit is contained in:
Eric Kohl 2022-05-16 01:46:32 +02:00
parent 15be457b6d
commit 032c50f87c
14 changed files with 3048 additions and 2812 deletions

View file

@ -16,6 +16,10 @@ VOID
HelpCommandList(VOID)
{
PCOMMAND cmdptr;
WCHAR szFormat[64];
WCHAR szOutput[256];
K32LoadStringW(GetModuleHandle(NULL), IDS_HELP_FORMAT_STRING, szFormat, ARRAYSIZE(szFormat));
/* Print the header information */
ConResPuts(StdOut, IDS_APP_HEADER);
@ -23,8 +27,13 @@ HelpCommandList(VOID)
/* List all the commands and the basic descriptions */
for (cmdptr = cmds; cmdptr->cmd1; cmdptr++)
if (cmdptr->help_desc != IDS_NONE)
ConResPuts(StdOut, cmdptr->help_desc);
{
if (cmdptr->cmd1 != NULL && cmdptr->cmd2 == NULL && cmdptr->cmd3 == NULL)
{
K32LoadStringW(GetModuleHandle(NULL), cmdptr->help, szOutput, ARRAYSIZE(szOutput));
ConPrintf(StdOut, szFormat, cmdptr->cmd1, szOutput);
}
}
ConPuts(StdOut, L"\n");
}
@ -34,12 +43,55 @@ BOOL
HelpCommand(
PCOMMAND pCommand)
{
if (pCommand->help != IDS_NONE)
PCOMMAND cmdptr;
BOOL bSubCommands = FALSE;
WCHAR szFormat[64];
WCHAR szOutput[256];
K32LoadStringW(GetModuleHandle(NULL), IDS_HELP_FORMAT_STRING, szFormat, ARRAYSIZE(szFormat));
ConPuts(StdOut, L"\n");
/* List all the commands and the basic descriptions */
for (cmdptr = cmds; cmdptr->cmd1; cmdptr++)
{
ConResPuts(StdOut, pCommand->help);
// ConPuts(StdOut, L"\n");
if (pCommand->cmd1 != NULL && pCommand->cmd2 == NULL && pCommand->cmd3 == NULL)
{
if (wcsicmp(pCommand->cmd1, cmdptr->cmd1) == 0 && cmdptr->cmd2 != NULL && cmdptr->cmd3 == NULL)
{
K32LoadStringW(GetModuleHandle(NULL), cmdptr->help, szOutput, ARRAYSIZE(szOutput));
ConPrintf(StdOut, szFormat, cmdptr->cmd2, szOutput);
bSubCommands = TRUE;
}
}
else if (pCommand->cmd1 != NULL && pCommand->cmd2 != NULL && pCommand->cmd3 == NULL)
{
if ((wcsicmp(pCommand->cmd1, cmdptr->cmd1) == 0) &&
(wcsicmp(pCommand->cmd2, cmdptr->cmd2) == 0) &&
(cmdptr->cmd3 != NULL))
{
K32LoadStringW(GetModuleHandle(NULL), cmdptr->help, szOutput, ARRAYSIZE(szOutput));
ConPrintf(StdOut, szFormat, cmdptr->cmd3, szOutput);
bSubCommands = TRUE;
}
}
else if (pCommand->cmd1 != NULL && pCommand->cmd2 != NULL && pCommand->cmd3 != NULL)
{
if ((wcsicmp(pCommand->cmd1, cmdptr->cmd1) == 0) &&
(wcsicmp(pCommand->cmd2, cmdptr->cmd2) == 0) &&
(wcsicmp(pCommand->cmd3, cmdptr->cmd3) == 0) &&
(cmdptr->help_detail != IDS_NONE))
ConResPuts(StdOut, cmdptr->help_detail);
}
}
if ((bSubCommands == FALSE) && (pCommand->help_detail != IDS_NONE))
{
ConResPuts(StdOut, pCommand->help_detail);
}
ConPuts(StdOut, L"\n");
return TRUE;
}