[Scummvm-cvs-logs] scummvm master -> 59d3b938d442fdae9709d1633d8ed8101ba95152

criezy criezy at scummvm.org
Wed Jun 22 23:50:11 CEST 2011


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

Summary:
2109fc7a3c COMMON: Improve loading of translations data file
4865572316 I18N: Update Hungarian translation from patch #3323744
59d3b938d4 I18N: Regenerate translations data file


Commit: 2109fc7a3c2f0e6c64401a07f24d292526ddbf2a
    https://github.com/scummvm/scummvm/commit/2109fc7a3c2f0e6c64401a07f24d292526ddbf2a
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-06-22T14:48:08-07:00

Commit Message:
COMMON: Improve loading of translations data file

Now if the header of the file is not correct it continues to look for a
valid file, while before if the first file found was obsolete or corrupted
translation was disabled even if a valid file was present in the search
path.

Changed paths:
    common/translation.cpp



diff --git a/common/translation.cpp b/common/translation.cpp
index 526bebc..59488c2 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -223,9 +223,17 @@ String TranslationManager::getLangById(int id) const {
 }
 
 bool TranslationManager::openTranslationsFile(File& inFile) {
-	// First try to open it directly (i.e. using the SearchMan).
-	if (inFile.open("translations.dat"))
-		return true;
+	// First try to open it using the SearchMan.
+	ArchiveMemberList fileList;
+	SearchMan.listMatchingMembers(fileList, "translations.dat");
+	for (ArchiveMemberList::iterator it = fileList.begin(); it != fileList.end(); ++it) {
+		SeekableReadStream *stream = it->get()->createReadStream();
+		if (stream && inFile.open(stream, it->get()->getName())) {
+			if (checkHeader(inFile))
+				return true;
+			inFile.close();
+		}
+	}
 
 	// Then look in the Themepath if we can find the file.
 	if (ConfMan.hasKey("themepath"))
@@ -243,8 +251,11 @@ bool TranslationManager::openTranslationsFile(const FSNode &node, File& inFile,
 	// necessary to make them here. But it avoid printing warnings.
 	FSNode fileNode = node.getChild("translations.dat");
 	if (fileNode.exists() && fileNode.isReadable() && !fileNode.isDirectory()) {
-		if (inFile.open(fileNode))
-			return true;
+		if (inFile.open(fileNode)) {
+			if (checkHeader(inFile))
+				return true;
+			inFile.close();
+		}
 	}
 
 	// Check if we exceeded the given recursion depth
@@ -268,13 +279,10 @@ bool TranslationManager::openTranslationsFile(const FSNode &node, File& inFile,
 void TranslationManager::loadTranslationsInfoDat() {
 	File in;
 	if (!openTranslationsFile(in)) {
-		warning("You are missing the 'translations.dat' file. GUI translation will not be available");
+		warning("You are missing a valid 'translations.dat' file. GUI translation will not be available");
 		return;
 	}
 
-	if (!checkHeader(in))
-		return;
-
 	char buf[256];
 	int len;
 
@@ -326,9 +334,6 @@ void TranslationManager::loadLanguageDat(int index) {
 	if (!openTranslationsFile(in))
 		return;
 
-	if (!checkHeader(in))
-		return;
-
 	char buf[1024];
 	int len;
 
@@ -386,7 +391,7 @@ bool TranslationManager::checkHeader(File &in) {
 
 	// Check header
 	if (strcmp(buf, "TRANSLATIONS")) {
-		warning("Your 'translations.dat' file is corrupt. GUI translation will not be available");
+		warning("File '%s' is not a valid translations data file. Skipping this file", in.getName());
 		return false;
 	}
 
@@ -394,7 +399,7 @@ bool TranslationManager::checkHeader(File &in) {
 	ver = in.readByte();
 
 	if (ver != TRANSLATIONS_DAT_VER) {
-		warning("Your 'translations.dat' file has a mismatching version, expected was %d but you got %d. GUI translation will not be available", TRANSLATIONS_DAT_VER, ver);
+		warning("File '%s' has a mismatching version, expected was %d but you got %d. Skipping this file", in.getName(), TRANSLATIONS_DAT_VER, ver);
 		return false;
 	}
 


Commit: 4865572316936cac14ea373de4d8ea0e0ac45b4b
    https://github.com/scummvm/scummvm/commit/4865572316936cac14ea373de4d8ea0e0ac45b4b
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-06-22T14:48:08-07:00

Commit Message:
I18N: Update Hungarian translation from patch #3323744

Changed paths:
    po/hu_HU.po



diff --git a/po/hu_HU.po b/po/hu_HU.po
index 78062e9..4663df0 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: ScummVM 1.3.0svn\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
 "POT-Creation-Date: 2011-06-20 23:09+0100\n"
-"PO-Revision-Date: 2011-06-15 07:42+0100\n"
+"PO-Revision-Date: 2011-06-21 09:54+0100\n"
 "Last-Translator: Gruby <grubycza at hotmail.com>\n"
 "Language-Team: Hungarian\n"
 "MIME-Version: 1.0\n"
@@ -1081,7 +1081,7 @@ msgstr "A motor nem t
 
 #: common/error.cpp:71
 msgid "User canceled"
-msgstr ""
+msgstr "Felhasználói megszakítás"
 
 #: common/error.cpp:75
 msgid "Unknown error"
@@ -1239,10 +1239,13 @@ msgid ""
 "ScummVM. As such, it is likely to be unstable, and any saves you make might "
 "not work in future versions of ScummVM."
 msgstr ""
+"FIGYELEM: A játékot amit indítani akarsz még nem teljesen támogatotja a "
+"ScummVM. Számíts rá hogy nem stabilan fut, és a mentések nem mûködnek a "
+"jövõbeni ScummVM verziókkal."
 
 #: engines/engine.cpp:408
 msgid "Start anyway"
-msgstr ""
+msgstr "Indítás így is"
 
 #: engines/scumm/dialogs.cpp:281
 msgid "~P~revious"


Commit: 59d3b938d442fdae9709d1633d8ed8101ba95152
    https://github.com/scummvm/scummvm/commit/59d3b938d442fdae9709d1633d8ed8101ba95152
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-06-22T14:48:09-07:00

Commit Message:
I18N: Regenerate translations data file

Changed paths:
    gui/themes/translations.dat



diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index 83155bb..f218747 100644
Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ






More information about the Scummvm-git-logs mailing list