[loc] set log messages to use English locale

* This is done to ensure I can understand logs that are sent to me,
  even when a non English locale is used.
* Closes #188.
This commit is contained in:
Pete Batard 2013-12-19 23:56:40 +00:00
parent f3cf32f8d8
commit 18c9df18b5
14 changed files with 225 additions and 120 deletions

View file

@ -70,16 +70,16 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command,
switch(Command) {
case FCC_PROGRESS:
percent = (DWORD*)pData;
PrintStatus(0, FALSE, lmprintf(MSG_217, *percent));
PrintStatus(0, FALSE, MSG_217, *percent);
UpdateProgress(OP_FORMAT, 1.0f * (*percent));
break;
case FCC_STRUCTURE_PROGRESS: // No progress on quick format
PrintStatus(0, TRUE, lmprintf(MSG_218, ++task_number, nb_steps[fs_index]));
PrintStatus(0, TRUE, MSG_218, ++task_number, nb_steps[fs_index]);
format_percent += 100.0f / (1.0f * nb_steps[fs_index]);
UpdateProgress(OP_CREATE_FS, format_percent);
break;
case FCC_DONE:
PrintStatus(0, TRUE, lmprintf(MSG_218, nb_steps[fs_index], nb_steps[fs_index]));
PrintStatus(0, TRUE, MSG_218, nb_steps[fs_index], nb_steps[fs_index]);
UpdateProgress(OP_CREATE_FS, 100.0f);
if(*(BOOLEAN*)pData == FALSE) {
uprintf("Error while formatting.\n");
@ -154,7 +154,7 @@ static BOOLEAN __stdcall ChkdskCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, DW
case FCC_PROGRESS:
case FCC_CHECKDISK_PROGRESS:
percent = (DWORD*)pData;
PrintStatus(0, FALSE, lmprintf(MSG_219, *percent));
PrintStatus(0, FALSE, MSG_219, *percent);
break;
case FCC_DONE:
if(*(BOOLEAN*)pData == FALSE) {
@ -369,7 +369,7 @@ static BOOL FormatFAT32(DWORD DriveIndex)
// Debug temp vars
ULONGLONG FatNeeded, ClusterCount;
PrintStatus(0, TRUE, lmprintf(MSG_222, "Large FAT32"));
PrintStatus(0, TRUE, MSG_222, "Large FAT32");
VolumeId = GetVolumeID();
// Open the drive and lock it
@ -564,7 +564,7 @@ static BOOL FormatFAT32(DWORD DriveIndex)
if (GetTickCount() > LastRefresh + 25) {
LastRefresh = GetTickCount();
format_percent = (100.0f*i)/(1.0f*(SystemAreaSize+BurstSize));
PrintStatus(0, FALSE, lmprintf(MSG_217, format_percent));
PrintStatus(0, FALSE, MSG_217, format_percent);
UpdateProgress(OP_FORMAT, format_percent);
}
if (IS_ERROR(FormatStatus)) goto out; // For cancellation
@ -589,7 +589,7 @@ static BOOL FormatFAT32(DWORD DriveIndex)
}
// Must do it here, as have issues when trying to write the PBR after a remount
PrintStatus(0, TRUE, lmprintf(MSG_229));
PrintStatus(0, TRUE, MSG_229);
if (!WritePBR(hLogicalVolume)) {
// Non fatal error, but the drive probably won't boot
uprintf("Could not write partition boot record - drive may not boot...\n");
@ -598,7 +598,7 @@ static BOOL FormatFAT32(DWORD DriveIndex)
// Set the FAT32 volume label
GetWindowTextW(hLabel, wLabel, ARRAYSIZE(wLabel));
ToValidLabel(wLabel, TRUE);
PrintStatus(0, TRUE, lmprintf(MSG_221));
PrintStatus(0, TRUE, MSG_221);
// Handle must be closed for SetVolumeLabel to work
safe_closehandle(hLogicalVolume);
VolumeName = GetLogicalName(DriveIndex, TRUE, TRUE);
@ -641,9 +641,9 @@ static BOOL FormatDrive(DWORD DriveIndex)
GetWindowTextU(hFileSystem, FSType, ARRAYSIZE(FSType));
fs = (int)ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem));
if ((fs == FS_UDF) && !((dur_mins == 0) && (dur_secs == 0))) {
PrintStatus(0, TRUE, lmprintf(MSG_220, FSType, dur_mins, dur_secs));
PrintStatus(0, TRUE, MSG_220, FSType, dur_mins, dur_secs);
} else {
PrintStatus(0, TRUE, lmprintf(MSG_222, FSType));
PrintStatus(0, TRUE, MSG_222, FSType);
}
VolumeName = GetLogicalName(DriveIndex, FALSE, TRUE);
wVolumeName = utf8_to_wchar(VolumeName);
@ -706,7 +706,7 @@ static BOOL CheckDisk(char DriveLetter)
size_t i;
wDriveRoot[0] = (WCHAR)DriveLetter;
PrintStatus(0, TRUE, lmprintf(MSG_223));
PrintStatus(0, TRUE, MSG_223);
PF_INIT_OR_OUT(Chkdsk, fmifs);
@ -799,7 +799,7 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
uint64_t i, last_sector = DiskSize/SectorSize;
unsigned char* pBuf = (unsigned char*) calloc(SectorSize, 1);
PrintStatus(0, TRUE, lmprintf(MSG_224));
PrintStatus(0, TRUE, MSG_224);
if (pBuf == NULL) {
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_NOT_ENOUGH_MEMORY;
goto out;
@ -1199,7 +1199,7 @@ DWORD WINAPI FormatThread(LPVOID param)
bt = GETBIOSTYPE((int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme)));
use_large_fat32 = (fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32));
PrintStatus(0, TRUE, lmprintf(MSG_225));
PrintStatus(0, TRUE, MSG_225);
hPhysicalDrive = GetPhysicalHandle(DriveIndex, TRUE, TRUE);
if (hPhysicalDrive == INVALID_HANDLE_VALUE) {
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_OPEN_FAILED;
@ -1240,7 +1240,7 @@ DWORD WINAPI FormatThread(LPVOID param)
}
CHECK_FOR_USER_CANCEL;
PrintStatus(0, TRUE, lmprintf(MSG_226));
PrintStatus(0, TRUE, MSG_226);
AnalyzeMBR(hPhysicalDrive);
if ((hLogicalVolume != NULL) && (hLogicalVolume != INVALID_HANDLE_VALUE)) {
AnalyzePBR(hLogicalVolume);
@ -1312,7 +1312,7 @@ DWORD WINAPI FormatThread(LPVOID param)
}
// Close the (unmounted) volume before formatting
if ((hLogicalVolume != NULL) && (hLogicalVolume != INVALID_HANDLE_VALUE)) {
PrintStatus(0, TRUE, lmprintf(MSG_227));
PrintStatus(0, TRUE, MSG_227);
if (!CloseHandle(hLogicalVolume)) {
uprintf("Could not close volume: %s\n", WindowsErrorString());
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_ACCESS_DENIED;
@ -1352,13 +1352,13 @@ DWORD WINAPI FormatThread(LPVOID param)
ret = use_large_fat32?FormatFAT32(DriveIndex):FormatDrive(DriveIndex);
if (!ret) {
// Error will be set by FormatDrive() in FormatStatus
uprintf("Format error: %s\n", StrError(FormatStatus));
uprintf("Format error: %s\n", StrError(FormatStatus, TRUE));
goto out;
}
// Thanks to Microsoft, we must fix the MBR AFTER the drive has been formatted
if (pt == PARTITION_STYLE_MBR) {
PrintStatus(0, TRUE, lmprintf(MSG_228));
PrintStatus(0, TRUE, MSG_228);
if (!WriteMBR(hPhysicalDrive)) {
if (!IS_ERROR(FormatStatus))
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_WRITE_FAULT;
@ -1405,7 +1405,7 @@ DWORD WINAPI FormatThread(LPVOID param)
}
// NB: if you unmount the logical volume here, XP will report error:
// [0x00000456] The media in the drive may have changed
PrintStatus(0, TRUE, lmprintf(MSG_229));
PrintStatus(0, TRUE, MSG_229);
if (!WritePBR(hLogicalVolume)) {
if (!IS_ERROR(FormatStatus))
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_WRITE_FAULT;
@ -1434,7 +1434,7 @@ DWORD WINAPI FormatThread(LPVOID param)
if (IsChecked(IDC_BOOT)) {
if ((dt == DT_WINME) || (dt == DT_FREEDOS)) {
UpdateProgress(OP_DOS, -1.0f);
PrintStatus(0, TRUE, lmprintf(MSG_230));
PrintStatus(0, TRUE, MSG_230);
if (!ExtractDOS(drive_name)) {
if (!IS_ERROR(FormatStatus))
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_CANNOT_COPY;
@ -1443,7 +1443,7 @@ DWORD WINAPI FormatThread(LPVOID param)
} else if (dt == DT_ISO) {
if (iso_path != NULL) {
UpdateProgress(OP_DOS, 0.0f);
PrintStatus(0, TRUE, lmprintf(MSG_231));
PrintStatus(0, TRUE, MSG_231);
drive_name[2] = 0;
if (!ExtractISO(iso_path, drive_name, FALSE)) {
if (!IS_ERROR(FormatStatus))
@ -1452,7 +1452,7 @@ DWORD WINAPI FormatThread(LPVOID param)
}
if ((bt == BT_UEFI) && (!iso_report.has_efi) && (iso_report.has_win7_efi)) {
// TODO: Check ISO with EFI only
PrintStatus(0, TRUE, lmprintf(MSG_232));
PrintStatus(0, TRUE, MSG_232);
wim_image[0] = drive_name[0];
efi_dst[0] = drive_name[0];
efi_dst[sizeof(efi_dst) - sizeof("\\bootx64.efi")] = 0;
@ -1475,7 +1475,7 @@ DWORD WINAPI FormatThread(LPVOID param)
}
}
UpdateProgress(OP_FINALIZE, -1.0f);
PrintStatus(0, TRUE, lmprintf(MSG_233));
PrintStatus(0, TRUE, MSG_233);
if (IsChecked(IDC_SET_ICON))
SetAutorun(drive_name);
// Issue another complete remount before we exit, to ensure we're clean