[Scummvm-git-logs] scummvm master -> c3140b8388eb6bafa07cb1efe18b215fcd89b650

yuv422 noreply at scummvm.org
Sat Dec 21 04:56:43 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c3140b8388 DARKSEED: Added localised in-game text for ES, FR & DE versions.


Commit: c3140b8388eb6bafa07cb1efe18b215fcd89b650
    https://github.com/scummvm/scummvm/commit/c3140b8388eb6bafa07cb1efe18b215fcd89b650
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2024-12-21T15:54:04+11:00

Commit Message:
DARKSEED: Added localised in-game text for ES, FR & DE versions.

Changed paths:
  A engines/darkseed/langtext.cpp
  A engines/darkseed/langtext.h
    engines/darkseed/animation.cpp
    engines/darkseed/console.cpp
    engines/darkseed/console.h
    engines/darkseed/darkseed.cpp
    engines/darkseed/module.mk
    engines/darkseed/usecode.cpp


diff --git a/engines/darkseed/animation.cpp b/engines/darkseed/animation.cpp
index 1b971c6f896..1841c6004b3 100644
--- a/engines/darkseed/animation.cpp
+++ b/engines/darkseed/animation.cpp
@@ -809,7 +809,7 @@ void Animation::updateAnimation() {
 				_spriteAnimCountdownTimer[0] = 3;
 				_objectVar[1] = 2000;
 			} else {
-				g_engine->_console->addTextLine("The cops ignore your demands for attention.");
+				g_engine->_console->addI18NText(kI18N_TheCopsIgnoreYourDemandsText);
 			}
 		}
 		if (_frameAdvanced && _player->_frameIdx == 1) {
diff --git a/engines/darkseed/console.cpp b/engines/darkseed/console.cpp
index bbe9b715d22..474766a2cdb 100644
--- a/engines/darkseed/console.cpp
+++ b/engines/darkseed/console.cpp
@@ -56,6 +56,10 @@ void Console::addToCurrentLine(const Common::String &text) {
 	addTextLine(_text[_startIdx] + text);
 }
 
+void Console::addI18NText(const I18nText &text) {
+	addTextLine(getI18NText(text));
+}
+
 void Console::draw(bool forceRedraw) {
 	if (!_redrawRequired && !forceRedraw) {
 		return;
diff --git a/engines/darkseed/console.h b/engines/darkseed/console.h
index 432057d7965..b9b8d990dc5 100644
--- a/engines/darkseed/console.h
+++ b/engines/darkseed/console.h
@@ -25,6 +25,7 @@
 #include "darkseed/gamefont.h"
 #include "darkseed/sound.h"
 #include "darkseed/tostext.h"
+#include "darkseed/langtext.h"
 
 namespace Darkseed {
 
@@ -45,6 +46,8 @@ public:
 	void addTextLine(const Common::String &text);
 	void addToCurrentLine(const Common::String &text);
 
+	void addI18NText(const I18nText &text);
+
 	void draw(bool forceRedraw = false);
 	void drawStringAt(int x, int y, const Common::String &text) const;
 
diff --git a/engines/darkseed/darkseed.cpp b/engines/darkseed/darkseed.cpp
index 16cfbae4851..71494e41e67 100644
--- a/engines/darkseed/darkseed.cpp
+++ b/engines/darkseed/darkseed.cpp
@@ -1659,15 +1659,15 @@ void DarkseedEngine::handleObjCollision(int targetObjNum) {
 
 void DarkseedEngine::lookCode(int objNum) {
 	if (objNum == 71 && _objectVar[71] == 2) {
-		_console->addTextLine("You see the car keys in the ignition.");
+		_console->addI18NText(kI18N_CarKeysIgnitionText);
 		return;
 	}
 	if (objNum == 189) {
-		_console->addTextLine("You see the iron bars of your cell.");
+		_console->addI18NText(kI18N_YouSeeIronBarsText);
 		return;
 	}
 	if (objNum == 141) {
-		_console->addTextLine("You see Delbert, not much to look at.");
+		_console->addI18NText(kI18N_YouSeeDelbertText);
 		return;
 	}
 	if (objNum == 42) {
@@ -1724,11 +1724,11 @@ void DarkseedEngine::lookCode(int objNum) {
 		return;
 	}
 	if (objNum == 138) {
-		_console->addTextLine("You see the clerk.");
+		_console->addI18NText(kI18N_YouSeeTheClerkText);
 		return;
 	}
 	if (objNum == 86 && _objectVar[86] != 0) {
-		_console->addTextLine("You see the open glove box.");
+		_console->addI18NText(kI18N_YouSeeTheOpenGloveBoxText);
 		return;
 	}
 	if (objNum == 9) {
@@ -1891,7 +1891,7 @@ void DarkseedEngine::lookCode(int objNum) {
 		}
 		return;
 	}
-	_console->addTextLine(Common::String::format("You see the %s.", _objectVar.getObjectName(objNum)));
+	_console->addTextLine(Common::String::format("%s %s.", getI18NText(kI18N_youSeeTheText), _objectVar.getObjectName(objNum)));
 }
 
 void DarkseedEngine::printTime() {
@@ -2414,7 +2414,7 @@ void DarkseedEngine::runObjects() {
 				} else {
 					playSound(25, 5, -1);
 				}
-				_console->addTextLine("The phone is ringing.");
+				_console->addI18NText(kI18N_ThePhoneIsRingingText);
 			}
 			break;
 		case 1080:
@@ -2442,7 +2442,7 @@ void DarkseedEngine::runObjects() {
 					playSound(29, 5, -1);
 //					FUN_1208_0dac_sound_related(95,5); TODO floppy sound
 				}
-				_console->addTextLine("The doorbell is ringing.");
+				_console->addI18NText(kI18N_TheDoorbellIsRingingText);
 			}
 			break;
 		case 900:
diff --git a/engines/darkseed/langtext.cpp b/engines/darkseed/langtext.cpp
new file mode 100644
index 00000000000..0266c4cefa0
--- /dev/null
+++ b/engines/darkseed/langtext.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+#include "darkseed/darkseed.h"
+#include "darkseed/langtext.h"
+
+namespace Darkseed {
+
+const char *getI18NText(const I18nText &text) {
+	switch (g_engine->getLanguage()) {
+	case Common::ES_ESP : return text.es;
+	case Common::FR_FRA : return text.fr;
+	case Common::DE_DEU : return text.de;
+	default : return text.en;
+	}
+}
+
+} // End of namespace Darkseed
diff --git a/engines/darkseed/langtext.h b/engines/darkseed/langtext.h
new file mode 100644
index 00000000000..71e04cc7beb
--- /dev/null
+++ b/engines/darkseed/langtext.h
@@ -0,0 +1,157 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+#ifndef DARKSEED_LANGTEXT_H
+#define DARKSEED_LANGTEXT_H
+
+namespace Darkseed {
+
+struct I18nText {
+	const char *en;
+	const char *es;
+	const char *fr;
+	const char *de;
+};
+
+const char *getI18NText(const I18nText &text);
+
+constexpr I18nText kI18N_blankText = {
+	"",
+	"",
+	"",
+	""
+};
+
+constexpr I18nText kI18N_CarKeysIgnitionText = {
+	"You see the car keys in the ignition.",
+	"VES LAS LLAVES DEL COCHE EN EL CONTACTO.",
+	"VOUS VOYEZ LES CLEFS DE LA VOTTURE DAUS LE STARTER.",
+	"DU SIEHSTDIE AUTOSCHLUSSEL IM ANLASSER."
+};
+
+constexpr I18nText kI18N_YouSeeIronBarsText = {
+	"You see the iron bars of your cell.",
+	"VES LAS BARRAS DE HIERRO DE TU CELDA.",
+	"VOUS VOYEZ LES BARREAUX DE FER DE VOTRE CELLULE.",
+	"DU SIEHST DIE EISENSTANGEN IN DER ZELLE."
+};
+
+constexpr I18nText kI18N_YouSeeDelbertText = {
+	"You see Delbert, not much to look at.",
+	"VES A DELBERT, NO HAY MUCHO QUE VER.",
+	"VOUS VOYEZ DELBERT, PAS GRAND CHOSE A VOIR.",
+	"DU SIEHST DELBERT, NICHT VIEL ZU SEHEN"
+};
+
+constexpr I18nText kI18N_YouSeeTheClerkText = {
+	"You see the clerk.",
+	"VES AL EMPLEADO.",
+	"VOUS VOYEZ L'HOMME.",
+	"DU SIEHST DEN MANN."
+};
+
+constexpr I18nText kI18N_YouSeeTheOpenGloveBoxText = {
+	"You see the open glove box.",
+	"VES LA CAJA DE LOS GUANTES ABIERTA.",
+	"VOUS VOYEZ LA BOITE DE GANT OUVERTE.",
+	"DU SIEHST DAS OFFENE HANDSCHUHFACH."
+};
+
+constexpr I18nText kI18N_youSeeTheText = {
+  "You see the",
+  "VES",
+  "VOUS VOYEZ",
+  "DU SIEHST"
+};
+
+constexpr I18nText kI18N_TheCopsIgnoreYourDemandsText = {
+  "The cops ignore your demands for attention.",
+  "LOS POLICIAS IGNORAN TUS LLAMADAS DE ATENCION.",
+  "LES FLICS IGNORENT VOTRE DEMANDE D'ATTENTION.",
+  "DIE POLIZISTEN BEACHTEN NICHT DEINE FORDERUNGEN."
+};
+
+constexpr I18nText kI18N_ThePhoneIsRingingText = {
+  "The phone is ringing.",
+  "EL TELEFONO ESTA SONANDO.",
+  "LE TELEPHONE SONNE.",
+  "DAS TELEFON KLINGELT."
+};
+
+constexpr I18nText kI18N_TheDoorbellIsRingingText = {
+  "The doorbell is ringing.",
+  "EL TIMBRE DE LA PUERTA ESTA SONANDO.",
+  "LA SONETTE DE LA PORTE SONNE.",
+  "DIE TUERKLINGEL LAEUTET."
+};
+
+constexpr I18nText kI18N_ChooseAnItemBeforeText = {
+  "Choose an item before giving clerk more money.",
+  "ELIGE UN OBJETO ANTES DE DARLE AL EMPLEADO MAS DINERO.",
+  "CHOISISSEZ QUELQUE CHOSE AVANT DE REMETTRE L'ARGENT A VENDEUR.",
+  "SUCHE ETWAS AUS BEVOR DU DEN MANN BEZAHLST."
+};
+
+constexpr I18nText kI18N_YouTouchDelbertText = {
+  "You touch Delbert...",
+  "TOCAS A DELBERT...",
+  "VOUS TOUCHEZ DELBERT.",
+  "GREIFE DELBERT AN..."
+};
+
+constexpr I18nText kI18N_YouTouchTheColdIronBarsText = {
+  "You touch the cold iron bars.",
+  "TOCAS LAS FRIAS BARRAS DE HIERRO.",
+  "VOUS TOUCHEZ LES BARREAUX DE FER.",
+  "GREIFE DIE KALTEN EISEN STANGEN AN."
+};
+
+constexpr I18nText kI18N_TheSergeantSaysNiceGunText = {
+  "The sergeant says 'Nice gun eh? It's a Browning'",
+  "EL SARGENTO DICE: 'BUENA PISTOLA, EH? ES UNA BROWNING.'",
+  "LE SERGENT DIT: BEAU REVOLVER HEIN, C'EST UN BROWNING.",
+  "DER SEARGENT SAGT 'SCHOENE PISTOLE, EH? ES IST EIN BROWNING.'"
+};
+
+constexpr I18nText kI18N_YouTurnOnTheMusicText = {
+  "You turn on the music.",
+  "PONES MUSICA.",
+  "VOUS METTEZ LA MUSIQUE.",
+  "SCHALTE DIE MUSIK AN."
+};
+
+constexpr I18nText kI18N_YouTurnOffTheMusicText = {
+  "You turn off the music.",
+  "QUITAS LA MUSICA.",
+  "VOUS ARRETEZ LA MUSIQUE.",
+  "SCHALTE DIE MUSIK AB."
+};
+
+constexpr I18nText kI18N_YouTouchTheOrnateSignalText = {
+  "You touch the surface of the ornate sigil.",
+  "TOCAS LA SUPERFICIE DE LA FIGURA ADORNADA.",
+  "VOUS TOUCHEZ LA SURFACE DE LA PIERRE MAGIQUE.",
+  "GREIFE DIE VERZAUBERTEN STEINE AN."
+};
+
+} // namespace Darkseed
+
+#endif //DARKSEED_LANGTEXT_H
diff --git a/engines/darkseed/module.mk b/engines/darkseed/module.mk
index e43b8a22880..19a90034ceb 100644
--- a/engines/darkseed/module.mk
+++ b/engines/darkseed/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS = \
 	gamefont.o \
 	img.o \
 	inventory.o \
+	langtext.o \
 	menu.o \
 	metaengine.o \
 	morph.o \
diff --git a/engines/darkseed/usecode.cpp b/engines/darkseed/usecode.cpp
index 46f03708a76..9fe6dca406f 100644
--- a/engines/darkseed/usecode.cpp
+++ b/engines/darkseed/usecode.cpp
@@ -159,11 +159,11 @@ void Darkseed::UseCode::useCode(int objNum) {
 	debug("useCode: objNum = %d", objNum);
 
 	if (objNum == 141) {
-		_console->addTextLine("You touch Delbert...");
+		_console->addI18NText(kI18N_YouTouchDelbertText);
 		return;
 	}
 	if (objNum == 189) {
-		_console->addTextLine("You touch the cold iron bars.");
+		_console->addI18NText(kI18N_YouTouchTheColdIronBarsText);
 		return;
 	}
 	if (objNum == 42) {
@@ -334,7 +334,7 @@ void Darkseed::UseCode::useCode(int objNum) {
 			return;
 		}
 		if ((objNum == 28) && (_objectVar[28] == 2)) {
-			_console->addTextLine("The sergeant says 'Nice gun eh? It's a Browning'");
+			_console->addI18NText(kI18N_TheSergeantSaysNiceGunText);
 			return;
 		}
 		if (objNum > 103 && objNum < 111) {
@@ -510,12 +510,12 @@ void Darkseed::UseCode::useCode(int objNum) {
 							g_engine->_sound->playMusic(MusicId::kRadio);
 							g_engine->playSound(0, 6, -1);
 							_objectVar[62] = 101;
-							_console->addTextLine("You turn on the music.");
+							_console->addI18NText(kI18N_YouTurnOnTheMusicText);
 						} else if (_objectVar[62] == 101) {
 							g_engine->_sound->killAllSound();
 							g_engine->_sound->stopMusic();
 							_objectVar[62] = 100;
-							_console->addTextLine("You turn off the music.");
+							_console->addI18NText(kI18N_YouTurnOffTheMusicText);
 						}
 					} else {
 						_objectVar[62] = _objectVar[62] + 1;
@@ -613,7 +613,7 @@ void Darkseed::UseCode::useCode(int objNum) {
 					_objectVar[66] = 0;
 				}
 			} else {
-				_console->addTextLine("You touch the surface of the ornate sigil.");
+				_console->addI18NText(kI18N_YouTouchTheOrnateSignalText);
 			}
 		} else if (objNum == 67 && _objectVar[68] == 0) {
 			if (_objectVar[12] == 2) {
@@ -628,7 +628,7 @@ void Darkseed::UseCode::useCode(int objNum) {
 					_objectVar[67] = 0;
 				}
 			} else {
-				_console->addTextLine("You touch the surface of the ornate sigil.");
+				_console->addI18NText(kI18N_YouTouchTheOrnateSignalText);
 			}
 		} else if ((objNum == 68) && (_objectVar[68] == 0)) {
 			if (_objectVar[12] == 2) {
@@ -640,7 +640,7 @@ void Darkseed::UseCode::useCode(int objNum) {
 					_objectVar[68] = 2;
 				}
 			} else {
-				_console->addTextLine("You touch the surface of the ornate sigil.");
+				_console->addI18NText(kI18N_YouTouchTheOrnateSignalText);
 			}
 		} else if (objNum == 84) {
 			_console->printTosText(566);
@@ -709,7 +709,7 @@ void Darkseed::UseCode::useCodeMoney(int16 targetObjNum) {
 		_player->loadAnimations("givclerk.nsp");
 		g_engine->_animation->setupOtherNspAnimation(6, 35);
 	} else {
-		_console->addTextLine("Choose an item before giving clerk more money.");
+		_console->addI18NText(kI18N_ChooseAnItemBeforeText);
 	}
 }
 




More information about the Scummvm-git-logs mailing list