[Scummvm-git-logs] scummvm branch-2-2 -> a3edb8ed963453fc928e2c2663f6a2ba9dc2947f

criezy criezy at scummvm.org
Thu Sep 3 01:28:23 UTC 2020


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:
a3edb8ed96 GLK: Do not translate text displayed by the Glk engine


Commit: a3edb8ed963453fc928e2c2663f6a2ba9dc2947f
    https://github.com/scummvm/scummvm/commit/a3edb8ed963453fc928e2c2663f6a2ba9dc2947f
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-09-03T02:25:42+01:00

Commit Message:
GLK: Do not translate text displayed by the Glk engine

The GLK engine can display ASCII or UTF-32 text, but does not
handle the charset we are using for the translations. So
non-ASCII characters in translated strings are not displayed
correctly. Thus it is better not to translate those at all.

In master, as we are using UTF-32 for all the translations,
it actually works properly. So this will be a new feature
for the 2.3.0 release ;-)

Changed paths:
    engines/glk/adrift/os_glk.cpp
    engines/glk/advsys/advsys.cpp
    engines/glk/advsys/vm.cpp
    engines/glk/comprehend/game.cpp
    engines/glk/glk_api.cpp
    engines/glk/scott/scott.cpp
    engines/glk/zcode/zcode.cpp


diff --git a/engines/glk/adrift/os_glk.cpp b/engines/glk/adrift/os_glk.cpp
index 958cf55d7d..c726a5d135 100644
--- a/engines/glk/adrift/os_glk.cpp
+++ b/engines/glk/adrift/os_glk.cpp
@@ -2811,7 +2811,7 @@ static int gsc_startup_code(Common::SeekableReadStream *game_stream, int restore
 		 * Display a brief loading game message; here we have to use a timeout
 		 * to ensure that the text is flushed to Glk.
 		 */
-		g_vm->glk_put_string(_("Loading game...\n"));
+		g_vm->glk_put_string("Loading game...\n");
 		if (g_vm->glk_gestalt(gestalt_Timer, 0)) {
 			event_t event;
 
diff --git a/engines/glk/advsys/advsys.cpp b/engines/glk/advsys/advsys.cpp
index a61033a506..41f2b6d602 100644
--- a/engines/glk/advsys/advsys.cpp
+++ b/engines/glk/advsys/advsys.cpp
@@ -45,7 +45,7 @@ void AdvSys::runGame() {
 			Common::ErrorCode err = loadGameState(_saveSlot).getCode();
 			_saveSlot = -1;
 			if (err != Common::kNoError)
-				print(_("Sorry, the savegame couldn't be restored"));
+				print("Sorry, the savegame couldn't be restored");
 			else
 				_pendingLine = "look";		// Do a look action after loading the savegame
 		}
diff --git a/engines/glk/advsys/vm.cpp b/engines/glk/advsys/vm.cpp
index 1cb42dad7b..4dc668a86e 100644
--- a/engines/glk/advsys/vm.cpp
+++ b/engines/glk/advsys/vm.cpp
@@ -311,12 +311,12 @@ void VM::opYORN() {
 
 void VM::opSAVE() {
 	if (saveGame().getCode() != Common::kNoError)
-		print(_("Sorry, the savegame couldn't be created"));
+		print("Sorry, the savegame couldn't be created");
 }
 
 void VM::opRESTORE() {
 	if (loadGame().getCode() != Common::kNoError)
-		print(_("Sorry, the savegame couldn't be restored"));
+		print("Sorry, the savegame couldn't be restored");
 }
 
 void VM::opARG() {
@@ -557,7 +557,7 @@ bool VM::getLine() {
 
 	skipSpaces(line);
 	if (line.empty()) {
-		print(_("Speak up! I can't hear you!\n"));
+		print("Speak up! I can't hear you!\n");
 		return false;
 	}
 
@@ -593,7 +593,7 @@ bool VM::getWord(Common::String &line) {
 		_words.push_back(iw);
 		return true;
 	} else {
-		Common::String msg = Common::String::format(_("I don't know the word \"%s\".\n"), iw._text.c_str());
+		Common::String msg = Common::String::format("I don't know the word \"%s\".\n", iw._text.c_str());
 		print(msg);
 		return false;
 	}
@@ -679,7 +679,7 @@ bool VM::match(int obj, int noun, const VM::AdjectiveEntry *adjectives) {
 }
 
 void VM::parseError() {
-	print(_("I don't understand.\n"));
+	print("I don't understand.\n");
 }
 
 bool VM::isWhitespace(char c) {
diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp
index bb3843063e..adab7b606d 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -1330,7 +1330,7 @@ void ComprehendGame::read_input() {
 
 		// Empty line, so toggle picture window visibility
 		g_comprehend->toggleGraphics();
-		g_comprehend->print(_("Picture window toggled\n"));
+		g_comprehend->print("Picture window toggled\n");
 
 		_updateFlags |= UPDATE_GRAPHICS;
 		update_graphics();
diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp
index d7ea0e0f30..92e824c74c 100644
--- a/engines/glk/glk_api.cpp
+++ b/engines/glk/glk_api.cpp
@@ -60,7 +60,7 @@ GlkAPI::GlkAPI(OSystem *syst, const GlkGameDescription &gameDesc) :
 }
 
 void GlkAPI::glk_exit(void) {
-	glk_put_string(_("[ press any key to exit ]"));
+	glk_put_string("[ press any key to exit ]");
 	_events->waitForPress();
 
 	// Trigger a ScumMVM shutdown of game
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index a974b839a9..6a18d251f2 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -96,10 +96,10 @@ void Scott::runGame() {
 
 		switch (performActions(vb, no)) {
 		case -1:
-			output(_("I don't understand your command. "));
+			output("I don't understand your command. ");
 			break;
 		case -2:
-			output(_("I can't do that yet. "));
+			output("I can't do that yet. ");
 			break;
 		default:
 			break;
@@ -115,9 +115,9 @@ void Scott::runGame() {
 				if (_items[LIGHT_SOURCE]._location == CARRIED ||
 						_items[LIGHT_SOURCE]._location == MY_LOC) {
 					if (_options & SCOTTLIGHT)
-						output(_("Light has run out! "));
+						output("Light has run out! ");
 					else
-						output(_("Your light has run out. "));
+						output("Your light has run out. ");
 				}
 				if (_options & PREHISTORIC_LAMP)
 					_items[LIGHT_SOURCE]._location = DESTROYED;
@@ -126,12 +126,12 @@ void Scott::runGame() {
 						_items[LIGHT_SOURCE]._location == MY_LOC) {
 
 					if (_options & SCOTTLIGHT) {
-						output(_("Light runs out in "));
+						output("Light runs out in ");
 						outputNumber(_gameHeader._lightTime);
-						output(_(" turns. "));
+						output(" turns. ");
 					} else {
 						if (_gameHeader._lightTime % 5 == 0)
-							output(_("Your light is growing dim. "));
+							output("Your light is growing dim. ");
 					}
 				}
 			}
@@ -391,7 +391,7 @@ void Scott::outputNumber(int a) {
 
 void Scott::look(void) {
 	const char *const ExitNames[6] = {
-		_("North"), _("South"), _("East"), _("West"), _("Up"), _("Down")
+		"North", "South", "East", "West", "Up", "Down"
 	};
 	Room *r;
 	int ct, f;
@@ -403,9 +403,9 @@ void Scott::look(void) {
 	if ((_bitFlags & (1 << DARKBIT)) && _items[LIGHT_SOURCE]._location != CARRIED
 			&& _items[LIGHT_SOURCE]._location != MY_LOC) {
 		if (_options & YOUARE)
-			display(_topWindow, _("You can't see. It is too dark!\n"));
+			display(_topWindow, "You can't see. It is too dark!\n");
 		else
-			display(_topWindow, _("I can't see. It is too dark!\n"));
+			display(_topWindow, "I can't see. It is too dark!\n");
 		if (_options & TRS80_STYLE)
 			display(_topWindow, TRS80_LINE);
 		return;
@@ -415,14 +415,14 @@ void Scott::look(void) {
 		display(_topWindow, "%s\n", r->_text.c_str() + 1);
 	else {
 		if (_options & YOUARE)
-			display(_topWindow, _("You are in a %s\n"), r->_text.c_str());
+			display(_topWindow, "You are in a %s\n", r->_text.c_str());
 		else
-			display(_topWindow, _("I'm in a %s\n"), r->_text.c_str());
+			display(_topWindow, "I'm in a %s\n", r->_text.c_str());
 	}
 
 	ct = 0;
 	f = 0;
-	display(_topWindow, _("\nObvious exits: "));
+	display(_topWindow, "\nObvious exits: ");
 	while (ct < 6) {
 		if (r->_exits[ct] != 0) {
 			if (f == 0)
@@ -435,7 +435,7 @@ void Scott::look(void) {
 	}
 
 	if (f == 0)
-		display(_topWindow, _("none"));
+		display(_topWindow, "none");
 	display(_topWindow, ".\n");
 	ct = 0;
 	f = 0;
@@ -444,10 +444,10 @@ void Scott::look(void) {
 		if (_items[ct]._location == MY_LOC) {
 			if (f == 0) {
 				if (_options & YOUARE) {
-					display(_topWindow, _("\nYou can also see: "));
+					display(_topWindow, "\nYou can also see: ");
 					pos = 18;
 				} else {
-					display(_topWindow, _("\nI can also see: "));
+					display(_topWindow, "\nI can also see: ");
 					pos = 16;
 				}
 				f++;
@@ -530,7 +530,7 @@ Common::Error Scott::writeGameData(Common::WriteStream *ws) {
 		ws->writeByte(0);
 	}
 
-	output(_("Saved.\n"));
+	output("Saved.\n");
 	return Common::kNoError;
 }
 
@@ -623,7 +623,7 @@ int Scott::getInput(int *vb, int *no) {
 		*vb = vc;
 		*no = nc;
 		if (vc == -1) {
-			output(_("You use word(s) I don't know! "));
+			output("You use word(s) I don't know! ");
 		}
 	} while (vc == -1);
 
@@ -753,9 +753,9 @@ int Scott::performLine(int ct) {
 			case 52:
 				if (countCarried() == _gameHeader._maxCarry) {
 					if (_options & YOUARE)
-						output(_("You are carrying too much. "));
+						output("You are carrying too much. ");
 					else
-						output(_("I've too much to carry! "));
+						output("I've too much to carry! ");
 					break;
 				}
 				_items[param[pptr++]]._location = CARRIED;
@@ -786,9 +786,9 @@ int Scott::performLine(int ct) {
 				break;
 			case 61:
 				if (_options & YOUARE)
-					output(_("You are dead.\n"));
+					output("You are dead.\n");
 				else
-					output(_("I am dead.\n"));
+					output("I am dead.\n");
 				_bitFlags &= ~(1 << DARKBIT);
 				MY_LOC = _gameHeader._numRooms;// It seems to be what the code says!
 				break;
@@ -800,7 +800,7 @@ int Scott::performLine(int ct) {
 			}
 			case 63:
 doneit:
-				output(_("The game is now over.\n"));
+				output("The game is now over.\n");
 				glk_exit();
 				return 0;
 			case 64:
@@ -815,15 +815,15 @@ doneit:
 					i++;
 				}
 				if (_options & YOUARE)
-					output(_("You have stored "));
+					output("You have stored ");
 				else
-					output(_("I've stored "));
+					output("I've stored ");
 				outputNumber(n);
-				output(_(" treasures.  On a scale of 0 to 100, that rates "));
+				output(" treasures.  On a scale of 0 to 100, that rates ");
 				outputNumber((n * 100) / _gameHeader._treasures);
 				output(".\n");
 				if (n == _gameHeader._treasures) {
-					output(_("Well done.\n"));
+					output("Well done.\n");
 					goto doneit;
 				}
 				break;
@@ -832,9 +832,9 @@ doneit:
 				int i = 0;
 				int f = 0;
 				if (_options & YOUARE)
-					output(_("You are carrying:\n"));
+					output("You are carrying:\n");
 				else
-					output(_("I'm carrying:\n"));
+					output("I'm carrying:\n");
 				while (i <= _gameHeader._numItems) {
 					if (_items[i]._location == CARRIED) {
 						if (f == 1) {
@@ -849,7 +849,7 @@ doneit:
 					i++;
 				}
 				if (f == 0)
-					output(_("Nothing"));
+					output("Nothing");
 				output(".\n");
 				break;
 			}
@@ -978,7 +978,7 @@ int Scott::performActions(int vb, int no) {
 	int fl;
 	int doagain = 0;
 	if (vb == 1 && no == -1) {
-		output(_("Give me a direction too."));
+		output("Give me a direction too.");
 		return 0;
 	}
 	if (vb == 1 && no >= 1 && no <= 6) {
@@ -987,7 +987,7 @@ int Scott::performActions(int vb, int no) {
 				_items[LIGHT_SOURCE]._location == CARRIED)
 			d = 0;
 		if (d)
-			output(_("Dangerous to move in the dark! "));
+			output("Dangerous to move in the dark! ");
 		nl = _rooms[MY_LOC]._exits[no - 1];
 		if (nl != 0) {
 			MY_LOC = nl;
@@ -995,16 +995,16 @@ int Scott::performActions(int vb, int no) {
 		}
 		if (d) {
 			if (_options & YOUARE)
-				output(_("You fell down and broke your neck. "));
+				output("You fell down and broke your neck. ");
 			else
-				output(_("I fell down and broke my neck. "));
+				output("I fell down and broke my neck. ");
 			glk_exit();
 			return 0;
 		}
 		if (_options & YOUARE)
-			output(_("You can't go in that direction. "));
+			output("You can't go in that direction. ");
 		else
-			output(_("I can't go in that direction. "));
+			output("I can't go in that direction. ");
 		return 0;
 	}
 
@@ -1062,7 +1062,7 @@ int Scott::performActions(int vb, int no) {
 					int f = 0;
 
 					if (d) {
-						output(_("It is dark.\n"));
+						output("It is dark.\n");
 						return 0;
 					}
 					while (i <= _gameHeader._numItems) {
@@ -1076,43 +1076,43 @@ int Scott::performActions(int vb, int no) {
 
 							if (countCarried() == _gameHeader._maxCarry) {
 								if (_options & YOUARE)
-									output(_("You are carrying too much. "));
+									output("You are carrying too much. ");
 								else
-									output(_("I've too much to carry. "));
+									output("I've too much to carry. ");
 								return 0;
 							}
 							_items[i]._location = CARRIED;
 							output(_items[i]._text);
-							output(_(": O.K.\n"));
+							output(": O.K.\n");
 							f = 1;
 						}
 						i++;
 					}
 					if (f == 0)
-						output(_("Nothing taken."));
+						output("Nothing taken.");
 					return 0;
 				}
 				if (no == -1) {
-					output(_("What ? "));
+					output("What ? ");
 					return 0;
 				}
 				if (countCarried() == _gameHeader._maxCarry) {
 					if (_options & YOUARE)
-						output(_("You are carrying too much. "));
+						output("You are carrying too much. ");
 					else
-						output(_("I've too much to carry. "));
+						output("I've too much to carry. ");
 					return 0;
 				}
 				item = matchUpItem(_nounText, MY_LOC);
 				if (item == -1) {
 					if (_options & YOUARE)
-						output(_("It is beyond your power to do that. "));
+						output("It is beyond your power to do that. ");
 					else
-						output(_("It's beyond my power to do that. "));
+						output("It's beyond my power to do that. ");
 					return 0;
 				}
 				_items[item]._location = CARRIED;
-				output(_("O.K. "));
+				output("O.K. ");
 				return 0;
 			}
 			if (vb == 18) {
@@ -1131,25 +1131,25 @@ int Scott::performActions(int vb, int no) {
 
 							_items[i]._location = MY_LOC;
 							output(_items[i]._text);
-							output(_(": O.K.\n"));
+							output(": O.K.\n");
 							f = 1;
 						}
 						i++;
 					}
 					if (f == 0)
-						output(_("Nothing dropped.\n"));
+						output("Nothing dropped.\n");
 					return 0;
 				}
 				if (no == -1) {
-					output(_("What ? "));
+					output("What ? ");
 					return 0;
 				}
 				item = matchUpItem(_nounText, CARRIED);
 				if (item == -1) {
 					if (_options & YOUARE)
-						output(_("It's beyond your power to do that.\n"));
+						output("It's beyond your power to do that.\n");
 					else
-						output(_("It's beyond my power to do that.\n"));
+						output("It's beyond my power to do that.\n");
 					return 0;
 				}
 				_items[item]._location = MY_LOC;
diff --git a/engines/glk/zcode/zcode.cpp b/engines/glk/zcode/zcode.cpp
index 66df44cb70..9cc830e4de 100644
--- a/engines/glk/zcode/zcode.cpp
+++ b/engines/glk/zcode/zcode.cpp
@@ -123,7 +123,7 @@ Common::Error ZCode::loadGameState(int slot) {
 			|| h_screen_cols != old_screen_cols))
 			erase_window(1);
 	} else {
-		error("%s", _("Error reading save file"));
+		error("%s", "Error reading save file");
 	}
 
 	return Common::kNoError;
@@ -141,7 +141,7 @@ Common::Error ZCode::saveGameState(int slot, const Common::String &desc, bool is
 	bool success = q.save(*file, this, desc);
 
 	if (!success)
-		print_string(_("Error writing save file\n"));
+		print_string("Error writing save file\n");
 
 	return Common::kNoError;
 




More information about the Scummvm-git-logs mailing list