mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:42:58 +00:00
- allow translation of strings in usetup
- so far most strings are still hardcoded, but the needed functionality is in place svn path=/trunk/; revision=32204
This commit is contained in:
parent
5aeda067d0
commit
3f09812318
5 changed files with 164 additions and 39 deletions
|
@ -1370,11 +1370,11 @@ SelectPartitionPage(PINPUT_RECORD Ir)
|
||||||
if (PartitionList->CurrentPartition == NULL ||
|
if (PartitionList->CurrentPartition == NULL ||
|
||||||
PartitionList->CurrentPartition->Unpartitioned == TRUE)
|
PartitionList->CurrentPartition->Unpartitioned == TRUE)
|
||||||
{
|
{
|
||||||
CONSOLE_SetStatusText (" ENTER = Install C = Create Partition F3 = Quit");
|
CONSOLE_SetStatusText (MUIGetString(STRING_INSTALLCREATEPARTITION));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CONSOLE_SetStatusText (" ENTER = Install D = Delete Partition F3 = Quit");
|
CONSOLE_SetStatusText (MUIGetString(STRING_INSTALLDELETEPARTITION));
|
||||||
}
|
}
|
||||||
|
|
||||||
CONSOLE_ConInKey(Ir);
|
CONSOLE_ConInKey(Ir);
|
||||||
|
@ -1495,7 +1495,7 @@ ShowPartitionSizeInputBox(SHORT Left,
|
||||||
/* Print message */
|
/* Print message */
|
||||||
coPos.X = Left + 2;
|
coPos.X = Left + 2;
|
||||||
coPos.Y = Top + 2;
|
coPos.Y = Top + 2;
|
||||||
strcpy (Buffer, "Size of new partition:");
|
strcpy (Buffer, MUIGetString(STRING_PARTITIONSIZE));
|
||||||
iLeft = coPos.X + strlen (Buffer) + 1;
|
iLeft = coPos.X + strlen (Buffer) + 1;
|
||||||
iTop = coPos.Y;
|
iTop = coPos.Y;
|
||||||
|
|
||||||
|
@ -1604,9 +1604,9 @@ CreatePartitionPage (PINPUT_RECORD Ir)
|
||||||
DiskEntry = PartitionList->CurrentDisk;
|
DiskEntry = PartitionList->CurrentDisk;
|
||||||
PartEntry = PartitionList->CurrentPartition;
|
PartEntry = PartitionList->CurrentPartition;
|
||||||
|
|
||||||
CONSOLE_SetStatusText (" Please wait...");
|
CONSOLE_SetStatusText (MUIGetString(STRING_PLEASEWAIT));
|
||||||
|
|
||||||
CONSOLE_SetTextXY (6, 8, "You have chosen to create a new partition on");
|
CONSOLE_SetTextXY (6, 8, MUIGetString(STRING_CHOOSENEWPARTITION));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (DiskEntry->DiskSize >= 0x280000000ULL) /* 10 GB */
|
if (DiskEntry->DiskSize >= 0x280000000ULL) /* 10 GB */
|
||||||
|
@ -1656,7 +1656,7 @@ CreatePartitionPage (PINPUT_RECORD Ir)
|
||||||
PartitionList->CurrentPartition->UnpartitionedLength / (1024*1024));
|
PartitionList->CurrentPartition->UnpartitionedLength / (1024*1024));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CONSOLE_SetStatusText (" ENTER = Create Partition ESC = Cancel F3 = Quit");
|
CONSOLE_SetStatusText (MUIGetString(STRING_CREATEPARTITION));
|
||||||
|
|
||||||
PartEntry = PartitionList->CurrentPartition;
|
PartEntry = PartitionList->CurrentPartition;
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
|
@ -2979,7 +2979,7 @@ FileCopyCallback(PVOID Context,
|
||||||
|
|
||||||
case SPFILENOTIFY_STARTCOPY:
|
case SPFILENOTIFY_STARTCOPY:
|
||||||
/* Display copy message */
|
/* Display copy message */
|
||||||
CONSOLE_SetStatusText(" \xB3 Copying file: %S", (PWSTR)Param1);
|
CONSOLE_SetStatusText(MUIGetString(STRING_COPYING), (PWSTR)Param1);
|
||||||
SetupUpdateMemoryInfo(CopyContext, FALSE);
|
SetupUpdateMemoryInfo(CopyContext, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3015,7 +3015,7 @@ FileCopyPage(PINPUT_RECORD Ir)
|
||||||
10,
|
10,
|
||||||
24,
|
24,
|
||||||
TRUE,
|
TRUE,
|
||||||
"Setup is copying files...");
|
MUIGetString(STRING_SETUPCOPYINGFILES));
|
||||||
|
|
||||||
/* Create the paged pool progress bar */
|
/* Create the paged pool progress bar */
|
||||||
CopyContext.MemoryBars[0] = CreateProgressBar(13,
|
CopyContext.MemoryBars[0] = CreateProgressBar(13,
|
||||||
|
@ -3025,7 +3025,7 @@ FileCopyPage(PINPUT_RECORD Ir)
|
||||||
10,
|
10,
|
||||||
44,
|
44,
|
||||||
FALSE,
|
FALSE,
|
||||||
"Paged Memory");
|
MUIGetString(STRING_PAGEDMEM));
|
||||||
|
|
||||||
/* Create the non paged pool progress bar */
|
/* Create the non paged pool progress bar */
|
||||||
CopyContext.MemoryBars[1] = CreateProgressBar(28,
|
CopyContext.MemoryBars[1] = CreateProgressBar(28,
|
||||||
|
@ -3035,7 +3035,7 @@ FileCopyPage(PINPUT_RECORD Ir)
|
||||||
24,
|
24,
|
||||||
44,
|
44,
|
||||||
FALSE,
|
FALSE,
|
||||||
"Nonpaged Memory");
|
MUIGetString(STRING_NONPAGEDMEM));
|
||||||
|
|
||||||
/* Create the global memory progress bar */
|
/* Create the global memory progress bar */
|
||||||
CopyContext.MemoryBars[2] = CreateProgressBar(43,
|
CopyContext.MemoryBars[2] = CreateProgressBar(43,
|
||||||
|
@ -3045,7 +3045,7 @@ FileCopyPage(PINPUT_RECORD Ir)
|
||||||
40,
|
40,
|
||||||
44,
|
44,
|
||||||
FALSE,
|
FALSE,
|
||||||
"Free Memory");
|
MUIGetString(STRING_FREEMEM));
|
||||||
|
|
||||||
/* Do the file copying */
|
/* Do the file copying */
|
||||||
SetupCommitFileQueueW(NULL,
|
SetupCommitFileQueueW(NULL,
|
||||||
|
|
|
@ -1574,4 +1574,31 @@ MUI_PAGE deDEPages[] =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MUI_STRING deDEStrings[] =
|
||||||
|
{
|
||||||
|
{STRING_INSTALLCREATEPARTITION,
|
||||||
|
" ENTER = Installieren C = Partition erstellen F3 = Beenden"},
|
||||||
|
{STRING_INSTALLDELETEPARTITION,
|
||||||
|
" ENTER = Installieren D = Partition löschen F3 = Beenden"},
|
||||||
|
{STRING_PARTITIONSIZE,
|
||||||
|
"Größe der neuen Partition:"},
|
||||||
|
{STRING_PLEASEWAIT,
|
||||||
|
" Bitte warten..."},
|
||||||
|
{STRING_CHOOSENEWPARTITION,
|
||||||
|
"Sie haben beschlossen eine neue Partition zu erstellen auf"},
|
||||||
|
{STRING_CREATEPARTITION,
|
||||||
|
" ENTER = Partition erstelln ESC = Abbruch F3 = Beenden"},
|
||||||
|
{STRING_COPYING,
|
||||||
|
" \xB3 Kopiere Datei: %S"},
|
||||||
|
{STRING_SETUPCOPYINGFILES,
|
||||||
|
"Setup kopiert Dateien..."},
|
||||||
|
{STRING_PAGEDMEM,
|
||||||
|
"Paged Memory"},
|
||||||
|
{STRING_NONPAGEDMEM,
|
||||||
|
"Nonpaged Memory"},
|
||||||
|
{STRING_FREEMEM,
|
||||||
|
"Free Memory"},
|
||||||
|
{0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1568,4 +1568,31 @@ MUI_PAGE enUSPages[] =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MUI_STRING enUSStrings[] =
|
||||||
|
{
|
||||||
|
{STRING_INSTALLCREATEPARTITION,
|
||||||
|
" ENTER = Install C = Create Partition F3 = Quit"},
|
||||||
|
{STRING_INSTALLDELETEPARTITION,
|
||||||
|
" ENTER = Install D = Delete Partition F3 = Quit"},
|
||||||
|
{STRING_PARTITIONSIZE,
|
||||||
|
"Size of new partition:"},
|
||||||
|
{STRING_PLEASEWAIT,
|
||||||
|
" Please wait..."},
|
||||||
|
{STRING_CHOOSENEWPARTITION,
|
||||||
|
"You have chosen to create a new partition on"},
|
||||||
|
{STRING_CREATEPARTITION,
|
||||||
|
" ENTER = Create Partition ESC = Cancel F3 = Quit"},
|
||||||
|
{STRING_COPYING,
|
||||||
|
" \xB3 Copying file: %S"},
|
||||||
|
{STRING_SETUPCOPYINGFILES,
|
||||||
|
"Setup is copying files..."},
|
||||||
|
{STRING_PAGEDMEM,
|
||||||
|
"Paged Memory"},
|
||||||
|
{STRING_NONPAGEDMEM,
|
||||||
|
"Nonpaged Memory"},
|
||||||
|
{STRING_FREEMEM,
|
||||||
|
"Free Memory"},
|
||||||
|
{0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -48,32 +48,32 @@
|
||||||
static const MUI_LANGUAGE LanguageList[] =
|
static const MUI_LANGUAGE LanguageList[] =
|
||||||
{
|
{
|
||||||
/* Lang ID, DefKbdLayout,ANSI CP, OEM CP, MAC CP, Language Name, page strgs,error strings */
|
/* Lang ID, DefKbdLayout,ANSI CP, OEM CP, MAC CP, Language Name, page strgs,error strings */
|
||||||
{L"00000409", L"00000409", L"1252", L"437", L"10000", L"English", enUSPages, enUSErrorEntries },
|
{L"00000409", L"00000409", L"1252", L"437", L"10000", L"English", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000402", L"00000402", L"1251", L"866", L"10007", L"Bulgarian", bgBGPages, bgBGErrorEntries },
|
{L"00000402", L"00000402", L"1251", L"866", L"10007", L"Bulgarian", bgBGPages, bgBGErrorEntries, enUSStrings },
|
||||||
{L"00000403", L"00000403", L"1252", L"850", L"10000", L"Catalan", enUSPages, enUSErrorEntries },
|
{L"00000403", L"00000403", L"1252", L"850", L"10000", L"Catalan", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000804", L"00000804", L"936", L"936", L"10008", L"Chinese (PRC)", enUSPages, enUSErrorEntries },
|
{L"00000804", L"00000804", L"936", L"936", L"10008", L"Chinese (PRC)", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000406", L"00000406", L"1252", L"850", L"10000", L"Danish", enUSPages, enUSErrorEntries },
|
{L"00000406", L"00000406", L"1252", L"850", L"10000", L"Danish", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000413", L"00000813", L"1252", L"850", L"10000", L"Dutch", enUSPages, enUSErrorEntries },
|
{L"00000413", L"00000813", L"1252", L"850", L"10000", L"Dutch", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"0000040B", L"0000040B", L"1252", L"850", L"10000", L"Finnish", enUSPages, enUSErrorEntries },
|
{L"0000040B", L"0000040B", L"1252", L"850", L"10000", L"Finnish", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"0000040C", L"0000040C", L"1252", L"850", L"10000", L"French", frFRPages, frFRErrorEntries },
|
{L"0000040C", L"0000040C", L"1252", L"850", L"10000", L"French", frFRPages, frFRErrorEntries, enUSStrings },
|
||||||
{L"00000407", L"00000407", L"1252", L"850", L"10000", L"German", deDEPages, deDEErrorEntries },
|
{L"00000407", L"00000407", L"1252", L"850", L"10000", L"German", deDEPages, deDEErrorEntries, deDEStrings },
|
||||||
{L"00000408", L"00000408", L"1253", L"737", L"10006", L"Greek", elGRPages, elGRErrorEntries },
|
{L"00000408", L"00000408", L"1253", L"737", L"10006", L"Greek", elGRPages, elGRErrorEntries, enUSStrings },
|
||||||
{L"0000040D", L"0000040D", L"1255", L"862", L"10005", L"Hebrew", enUSPages, enUSErrorEntries },
|
{L"0000040D", L"0000040D", L"1255", L"862", L"10005", L"Hebrew", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"0000040E", L"0000040E", L"1250", L"852", L"10029", L"Hungarian", enUSPages, enUSErrorEntries },
|
{L"0000040E", L"0000040E", L"1250", L"852", L"10029", L"Hungarian", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000410", L"00000410", L"1252", L"850", L"10000", L"Italian", itITPages, itITErrorEntries },
|
{L"00000410", L"00000410", L"1252", L"850", L"10000", L"Italian", itITPages, itITErrorEntries, enUSStrings },
|
||||||
{L"00000411", L"00000411", L"932", L"932", L"10001", L"Japanese", enUSPages, enUSErrorEntries },
|
{L"00000411", L"00000411", L"932", L"932", L"10001", L"Japanese", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000412", L"00000412", L"949", L"949", L"10003", L"Korean", enUSPages, enUSErrorEntries },
|
{L"00000412", L"00000412", L"949", L"949", L"10003", L"Korean", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000427", L"00000427", L"1257", L"775", L"10029", L"Lithuanian", ltLTPages, ltLTErrorEntries },
|
{L"00000427", L"00000427", L"1257", L"775", L"10029", L"Lithuanian", ltLTPages, ltLTErrorEntries, enUSStrings },
|
||||||
{L"00000414", L"00000414", L"1252", L"850", L"10000", L"Norwegian", enUSPages, enUSErrorEntries },
|
{L"00000414", L"00000414", L"1252", L"850", L"10000", L"Norwegian", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000419", L"00000419", L"1251", L"866", L"10007", L"Russian", ruRUPages, ruRUErrorEntries },
|
{L"00000419", L"00000419", L"1251", L"866", L"10007", L"Russian", ruRUPages, ruRUErrorEntries, enUSStrings },
|
||||||
{L"0000041B", L"0000041B", L"1250", L"852", L"10029", L"Slovak", skSKPages, skSKErrorEntries },
|
{L"0000041B", L"0000041B", L"1250", L"852", L"10029", L"Slovak", skSKPages, skSKErrorEntries, enUSStrings },
|
||||||
{L"0000040A", L"0000040A", L"1252", L"850", L"10000", L"Spanish", esESPages, esESErrorEntries },
|
{L"0000040A", L"0000040A", L"1252", L"850", L"10000", L"Spanish", esESPages, esESErrorEntries, enUSStrings },
|
||||||
{L"00000415", L"00000415", L"1250", L"852", L"10029", L"Polish", plPLPages, plPLErrorEntries },
|
{L"00000415", L"00000415", L"1250", L"852", L"10029", L"Polish", plPLPages, plPLErrorEntries, enUSStrings },
|
||||||
{L"00000816", L"00000816", L"1252", L"850", L"10000", L"Portuguese", enUSPages, enUSErrorEntries },
|
{L"00000816", L"00000816", L"1252", L"850", L"10000", L"Portuguese", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"0000041D", L"0000041D", L"1252", L"850", L"10000", L"Swedish", svSEPages, svSEErrorEntries },
|
{L"0000041D", L"0000041D", L"1252", L"850", L"10000", L"Swedish", svSEPages, svSEErrorEntries, enUSStrings },
|
||||||
{L"0000041E", L"0000041E", L"874", L"874", L"10021", L"Thai", enUSPages, enUSErrorEntries },
|
{L"0000041E", L"0000041E", L"874", L"874", L"10021", L"Thai", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"0000041F", L"0000041F", L"1254", L"857", L"10081", L"Turkish", enUSPages, enUSErrorEntries },
|
{L"0000041F", L"0000041F", L"1254", L"857", L"10081", L"Turkish", enUSPages, enUSErrorEntries, enUSStrings },
|
||||||
{L"00000422", L"00000422", L"1251", L"866", L"10017", L"Ukrainian", ukUAPages, ukUAErrorEntries },
|
{L"00000422", L"00000422", L"1251", L"866", L"10017", L"Ukrainian", ukUAPages, ukUAErrorEntries, enUSStrings },
|
||||||
{NULL, NULL, NULL, NULL, NULL}
|
{NULL, NULL, NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -140,6 +140,28 @@ FindMUIErrorEntries(VOID)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
const MUI_STRING *
|
||||||
|
FindMUIStringEntries(VOID)
|
||||||
|
{
|
||||||
|
ULONG lngIndex = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
/* First we search the language list till we find current selected language messages */
|
||||||
|
if (_wcsicmp(LanguageList[lngIndex].LanguageID , SelectedLanguageId) == 0)
|
||||||
|
{
|
||||||
|
/* Get all available strings for this language */
|
||||||
|
return LanguageList[lngIndex].MuiStrings;
|
||||||
|
}
|
||||||
|
|
||||||
|
lngIndex++;
|
||||||
|
}
|
||||||
|
while (LanguageList[lngIndex].MuiPages != NULL);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
LPCWSTR
|
LPCWSTR
|
||||||
MUIDefaultKeyboardLayout(VOID)
|
MUIDefaultKeyboardLayout(VOID)
|
||||||
{
|
{
|
||||||
|
@ -234,6 +256,32 @@ MUIDisplayError(IN ULONG ErrorNum, OUT PINPUT_RECORD Ir, IN ULONG WaitEvent)
|
||||||
WaitEvent);
|
WaitEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LPSTR
|
||||||
|
MUIGetString(ULONG Number)
|
||||||
|
{
|
||||||
|
ULONG i;
|
||||||
|
const MUI_STRING * entry;
|
||||||
|
|
||||||
|
entry = FindMUIStringEntries();
|
||||||
|
if (entry)
|
||||||
|
{
|
||||||
|
for (i = 0; entry[i].Number != 0; i++)
|
||||||
|
{
|
||||||
|
if (entry[i].Number == Number)
|
||||||
|
{
|
||||||
|
return entry[i].String;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PopupError("Error: Failed to find translated string",
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
POPUP_WAIT_NONE);
|
||||||
|
|
||||||
|
return "<nostring>";
|
||||||
|
}
|
||||||
|
|
||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
AddCodepageToRegistry(IN LPCWSTR ACPage, IN LPCWSTR OEMCPage, IN LPCWSTR MACCPage)
|
AddCodepageToRegistry(IN LPCWSTR ACPage, IN LPCWSTR OEMCPage, IN LPCWSTR MACCPage)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,6 +21,12 @@ typedef struct
|
||||||
MUI_ENTRY * MuiEntry;
|
MUI_ENTRY * MuiEntry;
|
||||||
}MUI_PAGE;
|
}MUI_PAGE;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
LONG Number;
|
||||||
|
LPSTR String;
|
||||||
|
} MUI_STRING;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
PWCHAR LanguageID;
|
PWCHAR LanguageID;
|
||||||
|
@ -31,6 +37,7 @@ typedef struct
|
||||||
PWCHAR LanguageDescriptor;
|
PWCHAR LanguageDescriptor;
|
||||||
const MUI_PAGE * MuiPages;
|
const MUI_PAGE * MuiPages;
|
||||||
const MUI_ERROR * MuiErrors;
|
const MUI_ERROR * MuiErrors;
|
||||||
|
const MUI_STRING * MuiStrings;
|
||||||
}MUI_LANGUAGE;
|
}MUI_LANGUAGE;
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,4 +66,20 @@ AddCodePage(VOID);
|
||||||
VOID
|
VOID
|
||||||
SetConsoleCodePage(VOID);
|
SetConsoleCodePage(VOID);
|
||||||
|
|
||||||
|
LPSTR
|
||||||
|
MUIGetString(ULONG Number);
|
||||||
|
|
||||||
|
#define STRING_INSTALLCREATEPARTITION 1
|
||||||
|
#define STRING_INSTALLDELETEPARTITION 2
|
||||||
|
#define STRING_CREATEPARTITION 3
|
||||||
|
#define STRING_PARTITIONSIZE 4
|
||||||
|
#define STRING_PLEASEWAIT 5
|
||||||
|
#define STRING_CHOOSENEWPARTITION 6
|
||||||
|
#define STRING_COPYING 7
|
||||||
|
#define STRING_SETUPCOPYINGFILES 8
|
||||||
|
#define STRING_PAGEDMEM 9
|
||||||
|
#define STRING_NONPAGEDMEM 10
|
||||||
|
#define STRING_FREEMEM 11
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue