SHERLOCK: SS: Make "Picked up" text multilingual

Bug #7002 should be fully solved now
This commit is contained in:
Martin Kiewitz 2016-02-11 22:38:56 +01:00
parent dbea55b36b
commit 9255fd3744
3 changed files with 29 additions and 3 deletions

View file

@ -179,22 +179,27 @@ FixedText::FixedText(SherlockEngine *vm) {
case Common::EN_ANY:
// Used by Sherlock Holmes 1+2
_fixedJournalTextArray = fixedJournalTextEN;
_fixedObjectPickedUpText = "Picked Up %s";
break;
case Common::DE_DEU:
// Used by Sherlock Holmes 1+2
_fixedJournalTextArray = fixedJournalTextDE;
_fixedObjectPickedUpText = "%s eingesteckt";
break;
case Common::FR_FRA:
// Used by Sherlock Holmes 2
_fixedJournalTextArray = fixedJournalTextFR;
_fixedObjectPickedUpText = ""; // Not used, because there is no French Sherlock Holmes 1
break;
case Common::ES_ESP:
// Used by Sherlock Holmes 1+2
_fixedJournalTextArray = fixedJournalTextES;
_fixedObjectPickedUpText = "Cogido/a %s";
break;
default:
// Default to English
_fixedJournalTextArray = fixedJournalTextEN;
_fixedObjectPickedUpText = "Picked Up %s";
break;
}
}
@ -210,4 +215,8 @@ const char *FixedText::getJournalText(int fixedJournalTextId) {
return _fixedJournalTextArray[fixedJournalTextId];
}
const char *FixedText::getObjectPickedUpText() {
return _fixedObjectPickedUpText;
}
} // End of namespace Sherlock

View file

@ -67,7 +67,7 @@ enum FixedJournalTextId {
kFixedJournalText_ThenTheInspectorAsked,
kFixedJournalText_ThenTheInspectorSaid,
kFixedJournalText_ThenPersonAsked,
kFixedJournalText_ThenPersonSaid
kFixedJournalText_ThenPersonSaid,
};
class SherlockEngine;
@ -96,8 +96,14 @@ public:
*/
const char *getJournalText(int fixedJournalTextId);
/**
* Gets object "Picked Up" text
*/
const char *getObjectPickedUpText();
private:
const char *const *_fixedJournalTextArray;
const char *_fixedObjectPickedUpText;
};
} // End of namespace Sherlock

View file

@ -1424,8 +1424,19 @@ int Object::pickUpObject(FixedTextActionId fixedTextActionId) {
ui.clearInfo();
Common::String itemName = _description;
// It's an item, make it lowercase
switch (_vm->getLanguage()) {
case Common::DE_DEU:
// don't do this for German version
break;
default:
// do it for English + Spanish version
itemName.setChar(tolower(itemName[0]), 0);
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "Picked up %s", itemName.c_str());
break;
}
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, fixedText.getObjectPickedUpText(), itemName.c_str());
ui._menuCounter = 25;
}
}