aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/journal.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-07 16:22:56 +0100
committerMartin Kiewitz2016-02-07 16:22:56 +0100
commit15be58dfb5a416897f9c10473ff9690cb24d914d (patch)
treecd924134adb9fcf65838326b13b3b96498303eee /engines/sherlock/journal.cpp
parente50f93f2987f41b6c9d193dcf07383ba415cb96d (diff)
downloadscummvm-rg350-15be58dfb5a416897f9c10473ff9690cb24d914d.tar.gz
scummvm-rg350-15be58dfb5a416897f9c10473ff9690cb24d914d.tar.bz2
scummvm-rg350-15be58dfb5a416897f9c10473ff9690cb24d914d.zip
SHERLOCK: Make journal entries multilingual
Spanish needs to be checked Spanish also needs to be copy and slightly changed for SH1 Also fixed Journal button text for French + Spanish Fixes bug #7019
Diffstat (limited to 'engines/sherlock/journal.cpp')
-rw-r--r--engines/sherlock/journal.cpp151
1 files changed, 118 insertions, 33 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index a30734c4f5..66f91c3a78 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -299,6 +299,7 @@ bool Journal::drawJournal(int direction, int howFar) {
}
void Journal::loadJournalFile(bool alreadyLoaded) {
+ FixedText &fixedText = *_vm->_fixedText;
People &people = *_vm->_people;
Screen &screen = *_vm->_screen;
Talk &talk = *_vm->_talk;
@@ -381,20 +382,34 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
// If Holmes has something to say first, then take care of it
if (!replyOnly) {
// Handle the grammar
- journalString += "Holmes ";
+ bool asked = false;
+
if (talk[journalEntry._statementNum]._statement.hasSuffix("?"))
- journalString += "asked ";
- else
- journalString += "said to ";
+ asked = true;
if (talk._talkTo == 1) {
- journalString += "me";
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_HolmesAskedMe);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_HolmesSaidToTheInspector);
+
} else if ((talk._talkTo == 2 && IS_SERRATED_SCALPEL) || (talk._talkTo == 18 && IS_ROSE_TATTOO)) {
- journalString += "the Inspector";
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_HolmesAskedTheInspector);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_HolmesSaidToMe);
+
} else {
- journalString += people._characters[talk._talkTo]._name;
+ const char *text = nullptr;
+ if (asked)
+ text = fixedText.getJournalText(kFixedJournalText_HolmesAskedPerson);
+ else
+ text = fixedText.getJournalText(kFixedJournalText_HolmesSaidToPerson);
+
+ journalString += Common::String::format(text, people._characters[talk._talkTo]._name);
}
- journalString += ", \"";
+
+ journalString += "\"";
// Add the statement
journalString += statement._statement;
@@ -457,29 +472,46 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
journalString += "\"\n";
if (talk._talkTo == 1)
- journalString += "I replied, \"";
+ journalString += fixedText.getJournalText(kFixedJournalText_IReplied);
else
- journalString += "The reply was, \"";
+ journalString += fixedText.getJournalText(kFixedJournalText_TheReplyWas);
} else {
- if (talk._talkTo == 1)
- journalString += "I";
- else if (talk._talkTo == inspectorId)
- journalString += "The Inspector";
- else
- journalString += people._characters[talk._talkTo]._name;
-
const byte *strP = replyP + 1;
byte v;
do {
v = *strP++;
} while (v && (v < opcodes[0]) && (v != '.') && (v != '!') && (v != '?'));
+ bool asked = false;
+
if (v == '?')
- journalString += " asked, \"";
- else
- journalString += " said, \"";
+ asked = true;
+
+ if (talk._talkTo == 1) {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_IAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_ISaid);
+
+ } else if (talk._talkTo == inspectorId) {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_TheInspectorAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_TheInspectorSaid);
+
+ } else {
+ const char *text = nullptr;
+ if (asked)
+ text = fixedText.getJournalText(kFixedJournalText_PersonAsked);
+ else
+ text = fixedText.getJournalText(kFixedJournalText_PersonSaid);
+
+ journalString += Common::String::format(text, people._characters[talk._talkTo]._name);
+ }
}
+ journalString += "\"";
+
startOfReply = false;
}
@@ -502,11 +534,13 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
justChangedSpeaker = true;
}
+ bool addPrefixThen = false;
+
if (!startOfReply) {
if (!commentFlag && !commentJustPrinted)
journalString += "\"\n";
- journalString += "Then ";
+ addPrefixThen = true; // "Then" should get added to the sentence
commentFlag = false;
} else if (!replyOnly) {
journalString += "\"\n";
@@ -517,15 +551,6 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
if (IS_ROSE_TATTOO)
replyP++;
- if (c == 0)
- journalString += "Holmes";
- else if (c == 1)
- journalString += "I";
- else if (c == inspectorId)
- journalString += "the Inspector";
- else
- journalString += people._characters[c]._name;
-
if (IS_SERRATED_SCALPEL && _vm->getLanguage() == Common::DE_DEU)
Scalpel::ScalpelTalk::skipBadText(replyP);
@@ -535,10 +560,70 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
v = *strP++;
} while (v && v < opcodes[0] && v != '.' && v != '!' && v != '?');
+ bool asked = false;
+
if (v == '?')
- journalString += " asked, \"";
- else
- journalString += " said, \"";
+ asked = true;
+
+ if (c == 0) {
+ // Holmes
+ if (addPrefixThen) {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_ThenHolmesAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_ThenHolmesSaid);
+ } else {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_HolmesAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_HolmesSaid);
+ }
+ } else if (c == 1) {
+ // I (Watson)
+ if (addPrefixThen) {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_ThenIAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_ThenISaid);
+ } else {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_IAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_ISaid);
+ }
+ } else if (c == inspectorId) {
+ // The Inspector
+ if (addPrefixThen) {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_ThenTheInspectorAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_ThenTheInspectorSaid);
+ } else {
+ if (asked)
+ journalString += fixedText.getJournalText(kFixedJournalText_TheInspectorAsked);
+ else
+ journalString += fixedText.getJournalText(kFixedJournalText_TheInspectorSaid);
+ }
+ } else {
+ // Person
+ const char *text = nullptr;
+ if (addPrefixThen) {
+ if (asked)
+ text = fixedText.getJournalText(kFixedJournalText_ThenPersonAsked);
+ else
+ text = fixedText.getJournalText(kFixedJournalText_ThenPersonSaid);
+ } else {
+ if (asked)
+ text = fixedText.getJournalText(kFixedJournalText_PersonAsked);
+ else
+ text = fixedText.getJournalText(kFixedJournalText_PersonSaid);
+ }
+
+ journalString += Common::String::format(text, people._characters[c]._name);
+ }
+
+ journalString += "\"";
+
} else {
if (IS_SERRATED_SCALPEL) {
// Control code, so move past it and any parameters