mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Removed my previous PanicAlert translation hack. Fixed with a better method suggested by BhaaL. The translation is done by a callback in the MsgHandler routine that is set at program start. Added macros PanicAlertT, SuccessAlertT, PanicYesNoT, and AskYesNoT that are identical to the non T versions except those strings will be added by gettext to the po files to be translated. These can and should be used anywhere in the code for strings that should be translated.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6838 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -71,7 +71,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
fail = false;
|
||||
if (!mcd)
|
||||
{
|
||||
if (!AskYesNo("\"%s\" does not exist.\n Create a new 16MB Memcard?", filename))
|
||||
if (!AskYesNoT("\"%s\" does not exist.\n Create a new 16MB Memcard?", filename))
|
||||
{
|
||||
fail = true;
|
||||
return;
|
||||
@ -83,7 +83,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
return;
|
||||
}
|
||||
mcdFile = mcd;
|
||||
Format(!AskYesNo("Format as ascii (NTSC\\PAL)?\nChoose no for sjis (NTSC-J)"));
|
||||
Format(!AskYesNoT("Format as ascii (NTSC\\PAL)?\nChoose no for sjis (NTSC-J)"));
|
||||
fclose(mcd);
|
||||
mcd = fopen(filename, "r+b");
|
||||
}
|
||||
@ -95,7 +95,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
if (strcasecmp(fileType.c_str(), ".raw") && strcasecmp(fileType.c_str(), ".gcp"))
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("File has the extension \"%s\"\nvalid extensions are (.raw/.gcp)", fileType.c_str());
|
||||
PanicAlertT("File has the extension \"%s\"\nvalid extensions are (.raw/.gcp)", fileType.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -104,31 +104,31 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
if (fread(&hdr, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read header correctly\n(0x0000-0x1FFF)");
|
||||
PanicAlertT("Failed to read header correctly\n(0x0000-0x1FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&dir, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read directory correctly\n(0x2000-0x3FFF)");
|
||||
PanicAlertT("Failed to read directory correctly\n(0x2000-0x3FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&dir_backup, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read directory backup correctly\n(0x4000-0x5FFF)");
|
||||
PanicAlertT("Failed to read directory backup correctly\n(0x4000-0x5FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&bat, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read block allocation table correctly\n(0x6000-0x7FFF)");
|
||||
PanicAlertT("Failed to read block allocation table correctly\n(0x6000-0x7FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&bat_backup, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read block allocation table backup correctly\n(0x8000-0x9FFF)");
|
||||
PanicAlertT("Failed to read block allocation table backup correctly\n(0x8000-0x9FFF)");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
// header checksum error!
|
||||
// invalid files do not always get here
|
||||
fail = true;
|
||||
PanicAlert("Header checksum failed");
|
||||
PanicAlertT("Header checksum failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
{
|
||||
// backup is also wrong!
|
||||
fail = true;
|
||||
PanicAlert("Directory checksum failed\n and Directory backup checksum failed");
|
||||
PanicAlertT("Directory checksum failed\n and Directory backup checksum failed");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -169,7 +169,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
{
|
||||
// backup is also wrong!
|
||||
fail = true;
|
||||
PanicAlert("Block Allocation Table checksum failed");
|
||||
PanicAlertT("Block Allocation Table checksum failed");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -211,13 +211,13 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
if (mc_data_size != read)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read save data\n(0xA000-)\nMemcard may be truncated");
|
||||
PanicAlertT("Failed to read save data\n(0xA000-)\nMemcard may be truncated");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
fail = true;
|
||||
PanicAlert("Memcard failed to load\n Card size is invalid (%04X)", sizeMb);
|
||||
PanicAlertT("Memcard failed to load\n Card size is invalid (%04X)", sizeMb);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,10 @@ CWiiSaveCrypted::CWiiSaveCrypted(const char* FileName, u64 title)
|
||||
// TODO: check_sig()
|
||||
if (b_valid)
|
||||
{
|
||||
SuccessAlert("Successfully imported save files");
|
||||
SuccessAlertT("Successfully imported save files");
|
||||
b_tryAgain = false;
|
||||
}
|
||||
else b_tryAgain = AskYesNo("Import failed, try again?");
|
||||
else b_tryAgain = AskYesNoT("Import failed, try again?");
|
||||
}while(b_tryAgain);
|
||||
}
|
||||
else
|
||||
@ -75,10 +75,10 @@ CWiiSaveCrypted::CWiiSaveCrypted(const char* FileName, u64 title)
|
||||
do_sig();
|
||||
if (b_valid)
|
||||
{
|
||||
SuccessAlert("Successfully exported file to %s", pathData_bin);
|
||||
SuccessAlertT("Successfully exported file to %s", pathData_bin);
|
||||
b_tryAgain = false;
|
||||
}
|
||||
else b_tryAgain = AskYesNo("Export failed, try again?");
|
||||
else b_tryAgain = AskYesNoT("Export failed, try again?");
|
||||
}while(b_tryAgain);
|
||||
}
|
||||
}
|
||||
@ -89,13 +89,13 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
fpData_bin = fopen(pathData_bin, "rb");
|
||||
if (!fpData_bin)
|
||||
{
|
||||
PanicAlert("Cannot open %s", pathData_bin);
|
||||
PanicAlertT("Cannot open %s", pathData_bin);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
if (fread(&_encryptedHeader, HEADER_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("failed to read header");
|
||||
PanicAlertT("failed to read header");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -106,7 +106,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
if ((_bannerSize < FULL_BNR_MIN) || (_bannerSize > FULL_BNR_MAX) ||
|
||||
(((_bannerSize - BNR_SZ) % ICON_SZ) != 0))
|
||||
{
|
||||
PanicAlert("not a wii save or read failure for file header size %x", _bannerSize);
|
||||
PanicAlertT("not a wii save or read failure for file header size %x", _bannerSize);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -117,7 +117,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
md5((u8*)&_header, HEADER_SZ, md5_calc);
|
||||
if (memcmp(md5_file, md5_calc, 0x10))
|
||||
{
|
||||
PanicAlert("MD5 mismatch\n %016llx%016llx != %016llx%016llx", Common::swap64(md5_file),Common::swap64(md5_file+8), Common::swap64(md5_calc), Common::swap64(md5_calc+8));
|
||||
PanicAlertT("MD5 mismatch\n %016llx%016llx != %016llx%016llx", Common::swap64(md5_file),Common::swap64(md5_file+8), Common::swap64(md5_calc), Common::swap64(md5_calc+8));
|
||||
b_valid= false;
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
if (!File::Exists(pathBanner_bin) || AskYesNo("%s already exists, overwrite?", pathBanner_bin))
|
||||
if (!File::Exists(pathBanner_bin) || AskYesNoT("%s already exists, overwrite?", pathBanner_bin))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "creating file %s", pathBanner_bin);
|
||||
fpBanner_bin = fopen(pathBanner_bin, "wb");
|
||||
@ -154,7 +154,7 @@ void CWiiSaveCrypted::WriteHDR()
|
||||
{
|
||||
if (fread(_header.BNR, Common::swap32(_header.hdr.BannerSize), 1, fpBanner_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to read banner.bin");
|
||||
PanicAlertT("Failed to read banner.bin");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -170,7 +170,7 @@ void CWiiSaveCrypted::WriteHDR()
|
||||
{
|
||||
if (fwrite(&_encryptedHeader, HEADER_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to write header for %s", pathData_bin);
|
||||
PanicAlertT("Failed to write header for %s", pathData_bin);
|
||||
b_valid = false;
|
||||
}
|
||||
fclose(fpData_bin);
|
||||
@ -186,14 +186,14 @@ void CWiiSaveCrypted::ReadBKHDR()
|
||||
fpData_bin = fopen(pathData_bin, "rb");
|
||||
if (!fpData_bin)
|
||||
{
|
||||
PanicAlert("Cannot open %s", pathData_bin);
|
||||
PanicAlertT("Cannot open %s", pathData_bin);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
fseeko(fpData_bin, HEADER_SZ, SEEK_SET);
|
||||
if (fread(&bkhdr, BK_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("failed to read bk header");
|
||||
PanicAlertT("failed to read bk header");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -202,7 +202,7 @@ void CWiiSaveCrypted::ReadBKHDR()
|
||||
if (bkhdr.size != Common::swap32(BK_LISTED_SZ) ||
|
||||
bkhdr.magic != Common::swap32(BK_HDR_MAGIC))
|
||||
{
|
||||
PanicAlert("Invalid Size(%x) or Magic word (%x)", bkhdr.size, bkhdr.magic);
|
||||
PanicAlertT("Invalid Size(%x) or Magic word (%x)", bkhdr.size, bkhdr.magic);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -246,7 +246,7 @@ void CWiiSaveCrypted::WriteBKHDR()
|
||||
{
|
||||
if (fwrite(&bkhdr, BK_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to write bkhdr");
|
||||
PanicAlertT("Failed to write bkhdr");
|
||||
b_valid = false;
|
||||
}
|
||||
fclose(fpData_bin);
|
||||
@ -260,7 +260,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
fpData_bin = fopen(pathData_bin, "rb");
|
||||
if (!fpData_bin)
|
||||
{
|
||||
PanicAlert("Cannot open %s", pathData_bin);
|
||||
PanicAlertT("Cannot open %s", pathData_bin);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -279,14 +279,14 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
|
||||
if (fread(&_tmpFileHDR, FILE_HDR_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to write header for file %d", i);
|
||||
PanicAlertT("Failed to write header for file %d", i);
|
||||
b_valid = false;
|
||||
}
|
||||
|
||||
lastpos += FILE_HDR_SZ;
|
||||
if(Common::swap32(_tmpFileHDR.magic) != FILE_HDR_MAGIC)
|
||||
{
|
||||
PanicAlert("Bad File Header");
|
||||
PanicAlertT("Bad File Header");
|
||||
break;
|
||||
}
|
||||
else
|
||||
@ -308,7 +308,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
_data = new u8[_fileSize];
|
||||
if (fread(_encryptedData, _fileSize, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to read data from file %d", i);
|
||||
PanicAlertT("Failed to read data from file %d", i);
|
||||
b_valid = false;
|
||||
break;
|
||||
}
|
||||
@ -318,7 +318,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
AES_cbc_encrypt((const unsigned char *)_encryptedData, _data, _fileSize, &m_AES_KEY, IV, AES_DECRYPT);
|
||||
delete []_encryptedData;
|
||||
|
||||
if (!File::Exists(pathRawSave) || AskYesNo("%s already exists, overwrite?", pathRawSave))
|
||||
if (!File::Exists(pathRawSave) || AskYesNoT("%s already exists, overwrite?", pathRawSave))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "creating file %s", pathRawSave);
|
||||
|
||||
@ -375,7 +375,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
|
||||
if (__name.length() > 0x44)
|
||||
{
|
||||
PanicAlert("%s is too long for the filename, max chars is 45", __name.c_str());
|
||||
PanicAlertT("%s is too long for the filename, max chars is 45", __name.c_str());
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -392,14 +392,14 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
{
|
||||
if (_fileSize == 0)
|
||||
{
|
||||
PanicAlert("%s is a 0 byte file", FilesList.at(i).c_str());
|
||||
PanicAlertT("%s is a 0 byte file", FilesList.at(i).c_str());
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
fpRawSaveFile = fopen(FilesList.at(i).c_str(), "rb");
|
||||
if (!fpRawSaveFile)
|
||||
{
|
||||
PanicAlert("%s failed to open", FilesList.at(i).c_str());
|
||||
PanicAlertT("%s failed to open", FilesList.at(i).c_str());
|
||||
b_valid = false;
|
||||
}
|
||||
__data = new u8[_roundedfileSize];
|
||||
@ -407,7 +407,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
memset(__data, 0, _roundedfileSize);
|
||||
if (fread(__data, _fileSize, 1, fpRawSaveFile) != 1)
|
||||
{
|
||||
PanicAlert("failed to read data from file: %s", FilesList.at(i).c_str());
|
||||
PanicAlertT("failed to read data from file: %s", FilesList.at(i).c_str());
|
||||
b_valid = false;
|
||||
}
|
||||
fclose(fpRawSaveFile);
|
||||
@ -530,14 +530,14 @@ bool CWiiSaveCrypted::getPaths(bool forExport)
|
||||
if(!File::IsDirectory(pathSavedir))
|
||||
{
|
||||
b_valid = false;
|
||||
PanicAlert("No save folder found for title %s", _saveGameString);
|
||||
PanicAlertT("No save folder found for title %s", _saveGameString);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!File::Exists(pathBanner_bin))
|
||||
{
|
||||
b_valid = false;
|
||||
PanicAlert("No banner file found for title %s", _saveGameString);
|
||||
PanicAlertT("No banner file found for title %s", _saveGameString);
|
||||
return false;
|
||||
}
|
||||
if (strlen(pathData_bin) == 0)
|
||||
@ -548,7 +548,7 @@ bool CWiiSaveCrypted::getPaths(bool forExport)
|
||||
else
|
||||
{
|
||||
File::CreateFullPath(pathSavedir);
|
||||
if (!AskYesNo("Warning! it is advised to backup all files in the folder:\n%s\nDo you wish to continue?", pathSavedir))
|
||||
if (!AskYesNoT("Warning! it is advised to backup all files in the folder:\n%s\nDo you wish to continue?", pathSavedir))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user