aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-12-17 12:45:38 +0100
committerGitHub2016-12-17 12:45:38 +0100
commit0e5788f4e3b4060c4a78527815ddbdc63c9f4d67 (patch)
tree9ef55ddefaa81c25fdd4e2c52873c369652360ef
parent34b2d3f97541673d2909d33ac525b730a7552ad6 (diff)
parentebaab44cd16ae784cebb66b7cf220842808a8bde (diff)
downloadscummvm-rg350-0e5788f4e3b4060c4a78527815ddbdc63c9f4d67.tar.gz
scummvm-rg350-0e5788f4e3b4060c4a78527815ddbdc63c9f4d67.tar.bz2
scummvm-rg350-0e5788f4e3b4060c4a78527815ddbdc63c9f4d67.zip
Merge pull request #866 from BenCastricum/editing
ALL: Unify messages concerning engine data files
-rw-r--r--engines/access/POTFILES1
-rw-r--r--engines/access/resources.cpp12
-rw-r--r--engines/drascula/POTFILES1
-rw-r--r--engines/drascula/drascula.cpp12
-rw-r--r--engines/hugo/POTFILES1
-rw-r--r--engines/hugo/hugo.cpp12
-rw-r--r--engines/kyra/staticres.cpp2
-rw-r--r--engines/lure/POTFILES1
-rw-r--r--engines/lure/lure.cpp7
-rw-r--r--engines/mortevielle/POTFILES1
-rw-r--r--engines/mortevielle/mortevielle.cpp18
-rw-r--r--engines/sky/compact.cpp12
-rw-r--r--engines/teenagent/resources.cpp5
-rw-r--r--engines/tony/POTFILES1
-rw-r--r--engines/tony/tony.cpp14
-rw-r--r--engines/toon/toon.cpp11
16 files changed, 72 insertions, 39 deletions
diff --git a/engines/access/POTFILES b/engines/access/POTFILES
new file mode 100644
index 0000000000..eafbe17056
--- /dev/null
+++ b/engines/access/POTFILES
@@ -0,0 +1 @@
+engines/access/resources.cpp
diff --git a/engines/access/resources.cpp b/engines/access/resources.cpp
index 096fb15b35..a7b23eb56d 100644
--- a/engines/access/resources.cpp
+++ b/engines/access/resources.cpp
@@ -24,6 +24,7 @@
#include "access/access.h"
#include "access/amazon/amazon_resources.h"
#include "access/martian/martian_resources.h"
+#include "common/translation.h"
namespace Access {
@@ -38,8 +39,9 @@ Resources *Resources::init(AccessEngine *vm) {
bool Resources::load(Common::String &errorMessage) {
Common::File f;
- if (!f.open("access.dat")) {
- errorMessage = "Could not locate required access.dat file";
+ Common::String filename = "access.dat";
+ if (!f.open(filename.c_str())) {
+ errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
return false;
}
@@ -47,7 +49,7 @@ bool Resources::load(Common::String &errorMessage) {
char buffer[4];
f.read(buffer, 4);
if (strncmp(buffer, "SVMA", 4)) {
- errorMessage = "Located access.dat file had invalid contents";
+ errorMessage = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
return false;
}
@@ -56,8 +58,8 @@ bool Resources::load(Common::String &errorMessage) {
uint version = f.readUint16LE();
if (version != expectedVersion) {
errorMessage = Common::String::format(
- "Incorrect version of access.dat found. Expected %d but got %d",
- expectedVersion, version);
+ _("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
+ filename.c_str(), expectedVersion, 0, version, 0);
return false;
}
diff --git a/engines/drascula/POTFILES b/engines/drascula/POTFILES
index ea79f9e066..925b309996 100644
--- a/engines/drascula/POTFILES
+++ b/engines/drascula/POTFILES
@@ -1,2 +1,3 @@
+engines/drascula/drascula.cpp
engines/drascula/detection.cpp
engines/drascula/saveload.cpp
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index ab91056480..655af480f2 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -25,6 +25,7 @@
#include "common/file.h"
#include "common/config-manager.h"
#include "common/textconsole.h"
+#include "common/translation.h"
#include "backends/audiocd/audiocd.h"
@@ -955,12 +956,13 @@ void DrasculaEngine::hipo_sin_nadie(int counter){
bool DrasculaEngine::loadDrasculaDat() {
Common::File in;
+ Common::String filename = "drascula.dat";
int i;
- in.open("drascula.dat");
+ in.open(filename.c_str());
if (!in.isOpen()) {
- Common::String errorMessage = "You're missing the 'drascula.dat' file. Get it from the ScummVM website";
+ Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.c_str());
@@ -974,7 +976,7 @@ bool DrasculaEngine::loadDrasculaDat() {
buf[8] = '\0';
if (strcmp(buf, "DRASCULA") != 0) {
- Common::String errorMessage = "File 'drascula.dat' is corrupt. Get it from the ScummVM website";
+ Common::String errorMessage = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.c_str());
@@ -984,7 +986,9 @@ bool DrasculaEngine::loadDrasculaDat() {
ver = in.readByte();
if (ver != DRASCULA_DAT_VER) {
- Common::String errorMessage = Common::String::format("File 'drascula.dat' is wrong version. Expected %d but got %d. Get it from the ScummVM website", DRASCULA_DAT_VER, ver);
+ Common::String errorMessage = Common::String::format(
+ _("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
+ filename.c_str(), DRASCULA_DAT_VER, 0, ver, 0);
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.c_str());
diff --git a/engines/hugo/POTFILES b/engines/hugo/POTFILES
index ff61e12ca5..b7b99ca095 100644
--- a/engines/hugo/POTFILES
+++ b/engines/hugo/POTFILES
@@ -1 +1,2 @@
+engines/hugo/hugo.cpp
engines/hugo/file.cpp
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 267eb08436..6881278cee 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -27,6 +27,7 @@
#include "common/debug-channels.h"
#include "common/config-manager.h"
#include "common/textconsole.h"
+#include "common/translation.h"
#include "hugo/hugo.h"
#include "hugo/console.h"
@@ -429,10 +430,11 @@ void HugoEngine::runMachine() {
*/
bool HugoEngine::loadHugoDat() {
Common::File in;
- in.open("hugo.dat");
+ Common::String filename = "hugo.dat";
+ in.open(filename.c_str());
if (!in.isOpen()) {
- Common::String errorMessage = "You're missing the 'hugo.dat' file. Get it from the ScummVM website";
+ Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.c_str());
return false;
@@ -443,7 +445,7 @@ bool HugoEngine::loadHugoDat() {
in.read(buf, 4);
if (memcmp(buf, "HUGO", 4)) {
- Common::String errorMessage = "File 'hugo.dat' is corrupt. Get it from the ScummVM website";
+ Common::String errorMessage = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(errorMessage);
return false;
}
@@ -452,7 +454,9 @@ bool HugoEngine::loadHugoDat() {
int minVer = in.readByte();
if ((majVer != HUGO_DAT_VER_MAJ) || (minVer != HUGO_DAT_VER_MIN)) {
- Common::String errorMessage = Common::String::format("File 'hugo.dat' is wrong version. Expected %d.%d but got %d.%d. Get it from the ScummVM website", HUGO_DAT_VER_MAJ, HUGO_DAT_VER_MIN, majVer, minVer);
+ Common::String errorMessage = Common::String::format(
+ _("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
+ filename.c_str(),HUGO_DAT_VER_MAJ, HUGO_DAT_VER_MIN, majVer, minVer);
GUIErrorMessage(errorMessage);
return false;
}
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 65f31985d6..5a45566c9a 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -161,7 +161,7 @@ bool StaticResource::loadStaticResourceFile() {
}
if (!foundWorkingKyraDat) {
- Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' file or it got corrupted, (re)get it from the ScummVM website";
+ Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' engine data file or it got corrupted.";
GUIErrorMessage(errorMessage);
error("%s", errorMessage.c_str());
}
diff --git a/engines/lure/POTFILES b/engines/lure/POTFILES
new file mode 100644
index 0000000000..d4fde2ab7b
--- /dev/null
+++ b/engines/lure/POTFILES
@@ -0,0 +1 @@
+engines/lure/lure.cpp
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index 45fe0af025..8eac519d8c 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -24,6 +24,7 @@
#include "common/debug-channels.h"
#include "common/system.h"
#include "common/savefile.h"
+#include "common/translation.h"
#include "engines/util.h"
@@ -60,7 +61,7 @@ Common::Error LureEngine::init() {
Common::File f;
VersionStructure version;
if (!f.open(SUPPORT_FILENAME)) {
- GUIError("Could not locate Lure support file");
+ GUIError(_("Unable to locate the '%s' engine data file."), SUPPORT_FILENAME);
return Common::kUnknownError;
}
@@ -69,10 +70,10 @@ Common::Error LureEngine::init() {
f.close();
if (READ_LE_UINT16(&version.id) != 0xffff) {
- GUIError("Error validating %s - file is invalid or out of date", SUPPORT_FILENAME);
+ GUIError(_("The '%s' engine data file is corrupt."), SUPPORT_FILENAME);
return Common::kUnknownError;
} else if ((version.vMajor != LURE_DAT_MAJOR) || (version.vMinor != LURE_DAT_MINOR)) {
- GUIError("Incorrect version of %s file - expected %d.%d but got %d.%d",
+ GUIError(_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
SUPPORT_FILENAME, LURE_DAT_MAJOR, LURE_DAT_MINOR,
version.vMajor, version.vMinor);
return Common::kUnknownError;
diff --git a/engines/mortevielle/POTFILES b/engines/mortevielle/POTFILES
new file mode 100644
index 0000000000..ee7ef3ed69
--- /dev/null
+++ b/engines/mortevielle/POTFILES
@@ -0,0 +1 @@
+engines/mortevielle/mortevielle.cpp
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4f0899deb4..59004cba7f 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -37,6 +37,7 @@
#include "common/system.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
+#include "common/translation.h"
#include "engines/util.h"
#include "engines/engine.h"
#include "graphics/palette.h"
@@ -302,7 +303,8 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
// Open the mort.dat file
if (!f.open(MORT_DAT)) {
- GUIErrorMessage("Could not locate 'mort.dat'.");
+ Common::String msg = Common::String::format(_("Unable to locate the '%s' engine data file."), MORT_DAT);
+ GUIErrorMessage(msg);
return Common::kReadingFailed;
}
@@ -310,16 +312,22 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
char fileId[4];
f.read(fileId, 4);
if (strncmp(fileId, "MORT", 4) != 0) {
- GUIErrorMessage("The located mort.dat data file is invalid");
+ Common::String msg = Common::String::format(_("The '%s' engine data file is corrupt."), MORT_DAT);
+ GUIErrorMessage(msg);
return Common::kReadingFailed;
}
// Check the version
- if (f.readByte() < MORT_DAT_REQUIRED_VERSION) {
- GUIErrorMessage("The located mort.dat data file is too old, please download an updated version on scummvm.org");
+ int majVer = f.readByte();
+ int minVer = f.readByte();
+
+ if (majVer < MORT_DAT_REQUIRED_VERSION) {
+ Common::String msg = Common::String::format(
+ _("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
+ MORT_DAT, MORT_DAT_REQUIRED_VERSION, 0, majVer, minVer);
+ GUIErrorMessage(msg);
return Common::kReadingFailed;
}
- f.readByte(); // Minor version
// Loop to load resources from the data file
while (f.pos() < f.size()) {
diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp
index c2ca557ec2..ab244c1f84 100644
--- a/engines/sky/compact.cpp
+++ b/engines/sky/compact.cpp
@@ -126,11 +126,11 @@ static const uint32 turnTableOffsets[] = {
SkyCompact::SkyCompact() {
_cptFile = new Common::File();
- if (!_cptFile->open("sky.cpt")) {
- GUI::MessageDialog dialog(_("Unable to find \"sky.cpt\" file!\n"
- "Please download it from www.scummvm.org"), _("OK"), NULL);
- dialog.runModal();
- error("Unable to find \"sky.cpt\" file\nPlease download it from www.scummvm.org");
+ Common::String filename = "sky.cpt";
+ if (!_cptFile->open(filename.c_str())) {
+ Common::String msg = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
+ GUIErrorMessage(msg);
+ error("%s", msg.c_str());
}
uint16 fileVersion = _cptFile->readUint16LE();
@@ -138,7 +138,7 @@ SkyCompact::SkyCompact() {
error("unknown \"sky.cpt\" version");
if (SKY_CPT_SIZE != _cptFile->size()) {
- GUI::MessageDialog dialog(_("The \"sky.cpt\" file has an incorrect size.\nPlease (re)download it from www.scummvm.org"), _("OK"), NULL);
+ GUI::MessageDialog dialog(_("The \"sky.cpt\" engine data file has an incorrect size."), _("OK"), NULL);
dialog.runModal();
error("Incorrect sky.cpt size (%d, expected: %d)", _cptFile->size(), SKY_CPT_SIZE);
}
diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp
index 3cf566a0e5..b7e0d558f1 100644
--- a/engines/teenagent/resources.cpp
+++ b/engines/teenagent/resources.cpp
@@ -91,9 +91,10 @@ void Resources::precomputeDialogOffsets() {
bool Resources::loadArchives(const ADGameDescription *gd) {
Common::File *dat_file = new Common::File();
- if (!dat_file->open("teenagent.dat")) {
+ Common::String filename = "teenagent.dat";
+ if (!dat_file->open(filename.c_str())) {
delete dat_file;
- Common::String errorMessage = _("You're missing the 'teenagent.dat' file. Get it from the ScummVM website");
+ Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
warning("%s", errorMessage.c_str());
GUIErrorMessage(errorMessage);
return false;
diff --git a/engines/tony/POTFILES b/engines/tony/POTFILES
new file mode 100644
index 0000000000..a2e3c09eab
--- /dev/null
+++ b/engines/tony/POTFILES
@@ -0,0 +1 @@
+engines/tony/tony.cpp
diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp
index c51f449aa1..8a7b676918 100644
--- a/engines/tony/tony.cpp
+++ b/engines/tony/tony.cpp
@@ -27,6 +27,7 @@
#include "common/events.h"
#include "common/file.h"
#include "common/installshield_cab.h"
+#include "common/translation.h"
#include "tony/tony.h"
#include "tony/custom.h"
#include "tony/debugger.h"
@@ -189,11 +190,12 @@ Common::ErrorCode TonyEngine::init() {
bool TonyEngine::loadTonyDat() {
Common::String msg;
Common::File in;
+ Common::String filename = "tony.dat";
- in.open("tony.dat");
+ in.open(filename.c_str());
if (!in.isOpen()) {
- msg = "You're missing the 'tony.dat' file. Get it from the ScummVM website";
+ msg = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
return false;
@@ -205,7 +207,7 @@ bool TonyEngine::loadTonyDat() {
buf[4] = '\0';
if (strcmp(buf, "TONY")) {
- msg = "File 'tony.dat' is corrupt. Get it from the ScummVM website";
+ msg = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
return false;
@@ -215,7 +217,9 @@ bool TonyEngine::loadTonyDat() {
int minVer = in.readByte();
if ((majVer != TONY_DAT_VER_MAJ) || (minVer != TONY_DAT_VER_MIN)) {
- msg = Common::String::format("File 'tony.dat' is wrong version. Expected %d.%d but got %d.%d. Get it from the ScummVM website", TONY_DAT_VER_MAJ, TONY_DAT_VER_MIN, majVer, minVer);
+ msg = Common::String::format(
+ _("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
+ filename.c_str(), TONY_DAT_VER_MAJ, TONY_DAT_VER_MIN, majVer, minVer);
GUIErrorMessage(msg);
warning("%s", msg.c_str());
@@ -251,7 +255,7 @@ bool TonyEngine::loadTonyDat() {
int numVariant = in.readUint16BE();
if (expectedLangVariant > numVariant - 1) {
- msg = Common::String::format("Font variant not present in 'tony.dat'. Get it from the ScummVM website");
+ msg = Common::String::format(_("Font variant not present in '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 43fb3a1b1f..dc1c515e1c 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -4909,12 +4909,13 @@ void ToonEngine::createShadowLUT() {
bool ToonEngine::loadToonDat() {
Common::File in;
Common::String msg;
+ Common::String filename = "toon.dat";
int majVer, minVer;
- in.open("toon.dat");
+ in.open(filename.c_str());
if (!in.isOpen()) {
- msg = _("You're missing the 'toon.dat' file. Get it from the ScummVM website");
+ msg = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
return false;
@@ -4926,7 +4927,7 @@ bool ToonEngine::loadToonDat() {
buf[4] = '\0';
if (strcmp(buf, "TOON")) {
- msg = _("File 'toon.dat' is corrupt. Get it from the ScummVM website");
+ msg = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
return false;
@@ -4936,7 +4937,9 @@ bool ToonEngine::loadToonDat() {
minVer = in.readByte();
if ((majVer != TOON_DAT_VER_MAJ) || (minVer != TOON_DAT_VER_MIN)) {
- msg = Common::String::format(_("File 'toon.dat' is wrong version. Expected %d.%d but got %d.%d. Get it from the ScummVM website"), TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer);
+ msg = Common::String::format(
+ _("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
+ filename.c_str(), TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer);
GUIErrorMessage(msg);
warning("%s", msg.c_str());