[Scummvm-cvs-logs] SF.net SVN: scummvm:[52308] scummvm/trunk

criezy at users.sourceforge.net criezy at users.sourceforge.net
Mon Aug 23 21:45:14 CEST 2010


Revision: 52308
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52308&view=rev
Author:   criezy
Date:     2010-08-23 19:45:14 +0000 (Mon, 23 Aug 2010)

Log Message:
-----------
i18n: Add support for context in translations.

This change means there can now be different translations for the same
english string depending on the context. It is based on gettext msgctxt feature.
There is a new macro _c(msg, ctxt) that should be used instead of _(msg) in
the source code when we want to add a context to the message. For the
moment I have added contexts to only one message ("None") so that I could
test the changes. Context could be added also to get shorter translations when
GUI is in 1x mode.

I have also added back the fuzzy option to msmerge since it is useful when
adding contexts to populate the translations for the new contexts.

Modified Paths:
--------------
    scummvm/trunk/common/translation.cpp
    scummvm/trunk/common/translation.h
    scummvm/trunk/gui/launcher.cpp
    scummvm/trunk/gui/options.cpp
    scummvm/trunk/gui/themes/translations.dat
    scummvm/trunk/po/ca_ES.po
    scummvm/trunk/po/de_DE.po
    scummvm/trunk/po/es_ES.po
    scummvm/trunk/po/fr_FR.po
    scummvm/trunk/po/hu_HU.po
    scummvm/trunk/po/it_IT.po
    scummvm/trunk/po/module.mk
    scummvm/trunk/po/ru_RU.po
    scummvm/trunk/po/scummvm.pot
    scummvm/trunk/po/uk_UA.po
    scummvm/trunk/tools/create_translations/create_translations.cpp

Modified: scummvm/trunk/common/translation.cpp
===================================================================
--- scummvm/trunk/common/translation.cpp	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/common/translation.cpp	2010-08-23 19:45:14 UTC (rev 52308)
@@ -29,7 +29,7 @@
 #undef ARRAYSIZE
 #endif
 
-#define TRANSLATIONS_DAT_VER 1
+#define TRANSLATIONS_DAT_VER 2
 
 #include "translation.h"
 
@@ -150,6 +150,10 @@
 }
 
 const char *TranslationManager::getTranslation(const char *message) {
+	return getTranslation(message, NULL);
+}
+
+const char *TranslationManager::getTranslation(const char *message, const char *context) {
 	// if no language is set or message is empty, return msgid as is
 	if (_currentTranslationMessages.empty() || *message == '\0')
 		return message;
@@ -160,13 +164,39 @@
 
 	while (rightIndex >= leftIndex) {
 		const int midIndex = (leftIndex + rightIndex) / 2;
-		const PoMessageEntry * const m = &_currentTranslationMessages[midIndex];
+		const PoMessageEntry *const m = &_currentTranslationMessages[midIndex];
 
-		const int compareResult = strcmp(message, _messageIds[m->msgid].c_str());
+		int compareResult = strcmp(message, _messageIds[m->msgid].c_str());
 
-		if (compareResult == 0)
-			return m->msgstr.c_str();
-		else if (compareResult < 0)
+		if (compareResult == 0) {
+			// Get the range of messages with the same ID (but different context)
+			leftIndex = rightIndex = midIndex;
+			while (
+				leftIndex > 0 &&
+				_currentTranslationMessages[leftIndex - 1].msgid == m->msgid
+			) {
+				--leftIndex;
+			}
+			while (
+				rightIndex < (int)_currentTranslationMessages.size() - 1 &&
+				_currentTranslationMessages[rightIndex + 1].msgid == m->msgid
+			) {
+				++rightIndex;
+			}
+			// Find the context we want
+			if (context == NULL || *context == '\0' || leftIndex == rightIndex)
+				return _currentTranslationMessages[leftIndex].msgstr.c_str();
+			// We could use again binary search, but there should be only a small number of contexts.
+			while (rightIndex > leftIndex) {
+				compareResult = strcmp(context, _currentTranslationMessages[rightIndex].msgctxt.c_str());
+				if (compareResult == 0)
+					return _currentTranslationMessages[rightIndex].msgstr.c_str();
+				else if (compareResult > 0)
+					break;
+				--rightIndex;
+			}
+			return _currentTranslationMessages[leftIndex].msgstr.c_str();
+		} else if (compareResult < 0)
 			rightIndex = midIndex - 1;
 		else
 			leftIndex = midIndex + 1;
@@ -185,6 +215,10 @@
 	return getTranslation(message.c_str());
 }
 
+String TranslationManager::getTranslation(const String &message, const String &context) {
+	return getTranslation(message.c_str(), context.c_str());
+}
+
 const TLangArray TranslationManager::getSupportedLanguageNames() const {
 	TLangArray languages;
 
@@ -314,6 +348,11 @@
 		len = in.readUint16BE();
 		in.read(buf, len);
 		_currentTranslationMessages[i].msgstr = String(buf, len);
+		len = in.readUint16BE();
+		if (len > 0) {
+			in.read(buf, len);
+			_currentTranslationMessages[i].msgctxt = String(buf, len);
+		}
 	}
 }
 
@@ -373,6 +412,14 @@
 	return message;
 }
 
+const char *TranslationManager::getTranslation(const char *message, const char *) {
+	return message;
+}
+
+String TranslationManager::getTranslation(const String &message, const String &) {
+	return message;
+}
+
 const TLangArray TranslationManager::getSupportedLanguageNames() const {
 	return TLangArray();
 }

Modified: scummvm/trunk/common/translation.h
===================================================================
--- scummvm/trunk/common/translation.h	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/common/translation.h	2010-08-23 19:45:14 UTC (rev 52308)
@@ -50,6 +50,7 @@
 
 struct PoMessageEntry {
 	int msgid;
+	String msgctxt;
 	String msgstr;
 };
 
@@ -114,6 +115,28 @@
 	 * it returns the original untranslated message.
 	 */
 	String getTranslation(const String &message);
+	
+	/**
+	 * Returns the translation into the current language of the parameter
+	 * message. In case the message isn't found in the translation catalog,
+	 * it returns the original untranslated message.
+	 *
+	 * If a translation is found for the given context it will return that
+	 * translation, otherwise it will look for a translation for the same
+	 * massage without a context or with a different context.
+	 */
+	const char *getTranslation(const char *message, const char *context);
+	
+	/**
+	 * Returns the translation into the current language of the parameter
+	 * message. In case the message isn't found in the translation catalog,
+	 * it returns the original untranslated message.
+	 *
+	 * If a translation is found for the given context it will return that
+	 * translation, otherwise it will look for a translation for the same
+	 * massage without a context or with a different context.
+	 */
+	String getTranslation(const String &message, const String &context);
 
 	/**
 	 * Returns a list of supported languages.
@@ -163,8 +186,10 @@
 
 #ifdef USE_TRANSLATION
 #define _(str) TransMan.getTranslation(str)
+#define _c(str, context) TransMan.getTranslation(str, context)
 #else
 #define _(str) str
+#define _c(str, context) str
 #endif
 
 #define _s(str) str

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/gui/launcher.cpp	2010-08-23 19:45:14 UTC (rev 52308)
@@ -286,7 +286,7 @@
 
 	String extraPath(ConfMan.get("extrapath", _domain));
 	if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
-		_extraPathWidget->setLabel(_("None"));
+		_extraPathWidget->setLabel(_c("None", "path"));
 	}
 
 	String savePath(ConfMan.get("savepath", _domain));
@@ -366,7 +366,7 @@
 			ConfMan.set("path", gamePath, _domain);
 
 		String extraPath(_extraPathWidget->getLabel());
-		if (!extraPath.empty() && (extraPath != _("None")))
+		if (!extraPath.empty() && (extraPath != _c("None", "path")))
 			ConfMan.set("extrapath", extraPath, _domain);
 
 		String savePath(_savePathWidget->getLabel());
@@ -415,7 +415,7 @@
 			Common::FSNode file(browser.getResult());
 			_soundFont->setLabel(file.getPath());
 
-			if (!file.getPath().empty() && (file.getPath() != _("None")))
+			if (!file.getPath().empty() && (file.getPath() != _c("None", "path")))
 				_soundFontClearButton->setEnabled(true);
 			else
 				_soundFontClearButton->setEnabled(false);

Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/gui/options.cpp	2010-08-23 19:45:14 UTC (rev 52308)
@@ -227,7 +227,7 @@
 
 		Common::String soundFont(ConfMan.get("soundfont", _domain));
 		if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) {
-			_soundFont->setLabel(_("None"));
+			_soundFont->setLabel(_c("None", "soundfont"));
 			_soundFontClearButton->setEnabled(false);
 		} else {
 			_soundFont->setLabel(soundFont);
@@ -396,7 +396,7 @@
 				ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain);
 
 				Common::String soundFont(_soundFont->getLabel());
-				if (!soundFont.empty() && (soundFont != _("None")))
+				if (!soundFont.empty() && (soundFont != _c("None", "soundfont")))
 					ConfMan.set("soundfont", soundFont, _domain);
 				else
 					ConfMan.removeKey("soundfont", _domain);
@@ -494,7 +494,7 @@
 		_subSpeedLabel->draw();
 		break;
 	case kClearSoundFontCmd:
-		_soundFont->setLabel(_("None"));
+		_soundFont->setLabel(_c("None", "soundfont"));
 		_soundFontClearButton->setEnabled(false);
 		draw();
 		break;
@@ -552,7 +552,7 @@
 	_soundFontButton->setEnabled(enabled);
 	_soundFont->setEnabled(enabled);
 
-	if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _("None")))
+	if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _c("None", "soundfont")))
 		_soundFontClearButton->setEnabled(enabled);
 	else
 		_soundFontClearButton->setEnabled(false);
@@ -730,7 +730,7 @@
 
 	// SoundFont
 	_soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd);
-	_soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"));
+	_soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _c("None", "soundfont"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"));
 	_soundFontClearButton = new ButtonWidget(boss, prefix + "mcFontClearButton", "C", _("Clear value"), kClearSoundFontCmd);
 
 	// Multi midi setting
@@ -954,14 +954,14 @@
 	_savePath = new StaticTextWidget(tab, "GlobalOptions_Paths.SavePath", "/foo/bar", _("Specifies where your savegames are put"));
 
 	new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), 0, kChooseThemeDirCmd);
-	_themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _("None"));
+	_themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _c("None", "path"));
 
 	new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
-	_extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _("None"), _("Specifies path to additional data used by all games or ScummVM"));
+	_extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _c("None", "path"), _("Specifies path to additional data used by all games or ScummVM"));
 
 #ifdef DYNAMIC_MODULES
 	new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), 0, kChoosePluginsDirCmd);
-	_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _("None"));
+	_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _c("None", "path"));
 #endif
 #endif
 
@@ -1051,19 +1051,19 @@
 	Common::String extraPath(ConfMan.get("extrapath", _domain));
 
 	if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
-		_savePath->setLabel(_("None"));
+		_savePath->setLabel(_c("None", "path"));
 	} else {
 		_savePath->setLabel(savePath);
 	}
 
 	if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) {
-		_themePath->setLabel(_("None"));
+		_themePath->setLabel(_c("None", "path"));
 	} else {
 		_themePath->setLabel(themePath);
 	}
 
 	if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
-		_extraPath->setLabel(_("None"));
+		_extraPath->setLabel(_c("None", "path"));
 	} else {
 		_extraPath->setLabel(extraPath);
 	}
@@ -1071,7 +1071,7 @@
 #ifdef DYNAMIC_MODULES
 	Common::String pluginsPath(ConfMan.get("pluginspath", _domain));
 	if (pluginsPath.empty() || !ConfMan.hasKey("pluginspath", _domain)) {
-		_pluginsPath->setLabel(_("None"));
+		_pluginsPath->setLabel(_c("None", "path"));
 	} else {
 		_pluginsPath->setLabel(pluginsPath);
 	}
@@ -1095,24 +1095,24 @@
 void GlobalOptionsDialog::close() {
 	if (getResult()) {
 		Common::String savePath(_savePath->getLabel());
-		if (!savePath.empty() && (savePath != _("None")))
+		if (!savePath.empty() && (savePath != _c("None", "path")))
 			ConfMan.set("savepath", savePath, _domain);
 
 		Common::String themePath(_themePath->getLabel());
-		if (!themePath.empty() && (themePath != _("None")))
+		if (!themePath.empty() && (themePath != _c("None", "path")))
 			ConfMan.set("themepath", themePath, _domain);
 		else
 			ConfMan.removeKey("themepath", _domain);
 
 		Common::String extraPath(_extraPath->getLabel());
-		if (!extraPath.empty() && (extraPath != _("None")))
+		if (!extraPath.empty() && (extraPath != _c("None", "path")))
 			ConfMan.set("extrapath", extraPath, _domain);
 		else
 			ConfMan.removeKey("extrapath", _domain);
 
 #ifdef DYNAMIC_MODULES
 		Common::String pluginsPath(_pluginsPath->getLabel());
-		if (!pluginsPath.empty() && (pluginsPath != _("None")))
+		if (!pluginsPath.empty() && (pluginsPath != _c("None", "path")))
 			ConfMan.set("pluginspath", pluginsPath, _domain);
 		else
 			ConfMan.removeKey("pluginspath", _domain);
@@ -1211,7 +1211,7 @@
 			Common::FSNode file(browser.getResult());
 			_soundFont->setLabel(file.getPath());
 
-			if (!file.getPath().empty() && (file.getPath() != _("None")))
+			if (!file.getPath().empty() && (file.getPath() != _c("None", "path")))
 				_soundFontClearButton->setEnabled(true);
 			else
 				_soundFontClearButton->setEnabled(false);

Modified: scummvm/trunk/gui/themes/translations.dat
===================================================================
(Binary files differ)

Modified: scummvm/trunk/po/ca_ES.po
===================================================================
--- scummvm/trunk/po/ca_ES.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/ca_ES.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,14 +7,14 @@
 msgstr ""
 "Project-Id-Version: ScummVM 1.2.0svn\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2010-06-26 16:45+0100\n"
 "Last-Translator: Jordi Vilalta Prat <jvprat at gmail.com>\n"
 "Language-Team: Catalan <scummvm-devel at lists.sf.net>\n"
+"Language: Catalan\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: Catalan\n"
 
 #: gui/about.cpp:96
 #, c-format
@@ -222,12 +222,12 @@
 msgstr "Especifica on es desaran les partides"
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+#, fuzzy
+msgctxt "path"
 msgid "None"
 msgstr "Cap"
 
@@ -465,6 +465,13 @@
 msgid "48 kHz"
 msgstr "48 kHz"
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+#, fuzzy
+msgctxt "soundfont"
+msgid "None"
+msgstr "Cap"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "Mode gr\xE0fic:"

Modified: scummvm/trunk/po/de_DE.po
===================================================================
--- scummvm/trunk/po/de_DE.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/de_DE.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,15 +7,15 @@
 msgstr ""
 "Project-Id-Version: ScummVM 1.2.0svn\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2010-08-12 00:56+0100\n"
 "Last-Translator: Simon Sawatzki\n"
 "Language-Team: Lothar Serra Mari <Lothar at Windowsbase.de> & Simon Sawatzki "
 "<SimSaw at gmx.de>\n"
+"Language: Deutsch\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: Deutsch\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
 #: gui/about.cpp:96
@@ -223,12 +223,12 @@
 msgstr "Legt fest, wo die Spielst\xE4nde abgelegt werden."
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+#, fuzzy
+msgctxt "path"
 msgid "None"
 msgstr "-"
 
@@ -465,6 +465,13 @@
 msgid "48 kHz"
 msgstr "48 kHz"
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+#, fuzzy
+msgctxt "soundfont"
+msgid "None"
+msgstr "-"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "Grafikmodus:"

Modified: scummvm/trunk/po/es_ES.po
===================================================================
--- scummvm/trunk/po/es_ES.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/es_ES.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,14 +7,14 @@
 msgstr ""
 "Project-Id-Version: ScummVM 1.2.0svn\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2010-07-30 22:17+0100\n"
 "Last-Translator: Tom\xE1s Maidagan\n"
 "Language-Team: \n"
+"Language: Espanol\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: Espanol\n"
 
 #: gui/about.cpp:96
 #, c-format
@@ -221,12 +221,12 @@
 msgstr "Especifica d\xF3nde guardar tus partidas"
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+#, fuzzy
+msgctxt "path"
 msgid "None"
 msgstr "Ninguno"
 
@@ -461,6 +461,13 @@
 msgid "48 kHz"
 msgstr "48 kHz"
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+#, fuzzy
+msgctxt "soundfont"
+msgid "None"
+msgstr "Ninguno"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "Modo gr\xE1fico:"

Modified: scummvm/trunk/po/fr_FR.po
===================================================================
--- scummvm/trunk/po/fr_FR.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/fr_FR.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,14 +7,14 @@
 msgstr ""
 "Project-Id-Version: ScummVM 1.2.0svn\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2010-08-11 22:14+0100\n"
 "Last-Translator: Thierry Crozat <criezy at scummvm.org>\n"
 "Language-Team: French <scummvm-devel at lists.sf.net>\n"
+"Language: Francais\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: Francais\n"
 "Plural-Forms: nplurals=2; plural=n>1;\n"
 
 #: gui/about.cpp:96
@@ -222,12 +222,11 @@
 msgstr "D\xE9finie l'emplacement o\xF9 les fichiers de sauvegarde sont cr\xE9\xE9s"
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+msgctxt "path"
 msgid "None"
 msgstr "Aucun"
 
@@ -463,6 +462,12 @@
 msgid "48 kHz"
 msgstr "48 kHz"
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+msgctxt "soundfont"
+msgid "None"
+msgstr "Aucune"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "Mode graphique:"
@@ -1423,8 +1428,8 @@
 
 #~ msgid "%s failed to instantiate engine: %s (target '%s', path '%s')"
 #~ msgstr ""
-#~ "Le plugin %s a \xE9chou\xE9 dans l'instanciation du moteur de jeu: %s (cible '%"
-#~ "s', chemin '%s')"
+#~ "Le plugin %s a \xE9chou\xE9 dans l'instanciation du moteur de jeu: %s (cible "
+#~ "'%s', chemin '%s')"
 
 #~ msgid "Ok"
 #~ msgstr "Ok"

Modified: scummvm/trunk/po/hu_HU.po
===================================================================
--- scummvm/trunk/po/hu_HU.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/hu_HU.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,14 +7,14 @@
 msgstr ""
 "Project-Id-Version: ScummVM VERSION\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2009-11-25 07:42-0500\n"
 "Last-Translator: Alex Bevilacqua <alexbevi at gmail.com>\n"
 "Language-Team: Hungarian\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=cp1250\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: \n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
 #: gui/about.cpp:96
@@ -220,12 +220,12 @@
 msgstr ""
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+#, fuzzy
+msgctxt "path"
 msgid "None"
 msgstr "Semmi"
 
@@ -459,6 +459,13 @@
 msgid "48 kHz"
 msgstr ""
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+#, fuzzy
+msgctxt "soundfont"
+msgid "None"
+msgstr "Semmi"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "Grafikus m\xF3d:"

Modified: scummvm/trunk/po/it_IT.po
===================================================================
--- scummvm/trunk/po/it_IT.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/it_IT.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,14 +7,14 @@
 msgstr ""
 "Project-Id-Version: ScummVM 1.2.0svn\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2010-06-30 23:56+0100\n"
 "Last-Translator: Maff <matteo.maff at gmail dot com>\n"
 "Language-Team: Italian\n"
+"Language: Italiano\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: Italiano\n"
 
 #: gui/about.cpp:96
 #, c-format
@@ -221,12 +221,12 @@
 msgstr "Specifica dove archiviare i salvataggi"
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+#, fuzzy
+msgctxt "path"
 msgid "None"
 msgstr "Nessuno"
 
@@ -464,6 +464,13 @@
 msgid "48 kHz"
 msgstr "48 kHz"
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+#, fuzzy
+msgctxt "soundfont"
+msgid "None"
+msgstr "Nessuno"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "Modalit\xE0:"

Modified: scummvm/trunk/po/module.mk
===================================================================
--- scummvm/trunk/po/module.mk	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/module.mk	2010-08-23 19:45:14 UTC (rev 52308)
@@ -2,7 +2,7 @@
 POFILES := $(wildcard $(srcdir)/po/*.po)
 
 updatepot:
-	xgettext -f $(srcdir)/po/POTFILES -D $(srcdir) -d scummvm --c++ -k_ -k_s -o $(POTFILE) \
+	xgettext -f $(srcdir)/po/POTFILES -D $(srcdir) -d scummvm --c++ -k_ -k_s -k_c:1,2c -o $(POTFILE) \
 		"--copyright-holder=ScummVM Team" --package-name=ScummVM \
 		--package-version=$(VERSION) --msgid-bugs-address=scummvm-devel at lists.sf.net -o $(POTFILE)_
 
@@ -25,7 +25,7 @@
 	fi;
 
 %.po: $(POTFILE)
-	msgmerge -N $@ $(POTFILE) -o $@.new
+	msgmerge $@ $(POTFILE) -o $@.new
 	if cmp $@ $@.new >/dev/null 2>&1; then \
 		rm -f $@.new; \
 	else \

Modified: scummvm/trunk/po/ru_RU.po
===================================================================
--- scummvm/trunk/po/ru_RU.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/ru_RU.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,16 +7,16 @@
 msgstr ""
 "Project-Id-Version: ScummVM VERSION\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2010-06-13 20:55+0300\n"
 "Last-Translator: Eugene Sandulenko <sev at scummvm.org>\n"
 "Language-Team: Russian\n"
+"Language: Russian\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-5\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: Russian\n"
-"Plural-Forms: nplurals=3;     plural=n%10==1 && n%100!=11 ? 0 :            n%"
-"10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3;     plural=n%10==1 && n%100!=11 ? 0 :            n"
+"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
 
 #: gui/about.cpp:96
 #, c-format
@@ -223,12 +223,12 @@
 msgstr "\xC3\xDA\xD0\xD7\xEB\xD2\xD0\xD5\xE2 \xDF\xE3\xE2\xEC \xDA \xE1\xDE\xE5\xE0\xD0\xDD\xD5\xDD\xD8\xEF\xDC \xD8\xD3\xE0\xEB"
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+#, fuzzy
+msgctxt "path"
 msgid "None"
 msgstr "\xBD\xD5 \xD7\xD0\xD4\xD0\xDD"
 
@@ -462,6 +462,13 @@
 msgid "48 kHz"
 msgstr "48 ڳ\xE6"
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+#, fuzzy
+msgctxt "soundfont"
+msgid "None"
+msgstr "\xBD\xD5 \xD7\xD0\xD4\xD0\xDD"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "\xB3\xE0\xD0\xE4. \xE0\xD5\xD6\xD8\xDC:"

Modified: scummvm/trunk/po/scummvm.pot
===================================================================
--- scummvm/trunk/po/scummvm.pot	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/scummvm.pot	2010-08-23 19:45:14 UTC (rev 52308)
@@ -8,10 +8,11 @@
 msgstr ""
 "Project-Id-Version: ScummVM 1.2.0svn\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -217,12 +218,11 @@
 msgstr ""
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+msgctxt "path"
 msgid "None"
 msgstr ""
 
@@ -454,6 +454,12 @@
 msgid "48 kHz"
 msgstr ""
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+msgctxt "soundfont"
+msgid "None"
+msgstr ""
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr ""

Modified: scummvm/trunk/po/uk_UA.po
===================================================================
--- scummvm/trunk/po/uk_UA.po	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/po/uk_UA.po	2010-08-23 19:45:14 UTC (rev 52308)
@@ -7,16 +7,16 @@
 msgstr ""
 "Project-Id-Version: ScummVM VERSION\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2010-08-19 13:30+0300\n"
+"POT-Creation-Date: 2010-08-23 20:16+0100\n"
 "PO-Revision-Date: 2010-07-30 22:19+0100\n"
 "Last-Translator: Lubomyr Lisen\n"
 "Language-Team: Ukrainian\n"
+"Language: Ukrainian\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-5\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: Ukrainian\n"
-"Plural-Forms: nplurals=3;     plural=n%10==1 && n%100!=11 ? 0 :            n%"
-"10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3;     plural=n%10==1 && n%100!=11 ? 0 :            n"
+"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
 
 #: gui/about.cpp:96
 #, c-format
@@ -225,12 +225,12 @@
 msgstr "\xB2\xDA\xD0\xD7\xE3\xF4 \xE8\xDB\xEF\xE5 \xD4\xDE \xD7\xD1\xD5\xE0\xD5\xD6\xD5\xDD\xEC \xD3\xE0\xD8"
 
 #: gui/launcher.cpp:289 gui/launcher.cpp:369 gui/launcher.cpp:418
-#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
-#: gui/options.cpp:555 gui/options.cpp:733 gui/options.cpp:957
-#: gui/options.cpp:960 gui/options.cpp:964 gui/options.cpp:1054
-#: gui/options.cpp:1060 gui/options.cpp:1066 gui/options.cpp:1074
-#: gui/options.cpp:1098 gui/options.cpp:1102 gui/options.cpp:1108
-#: gui/options.cpp:1115 gui/options.cpp:1214
+#: gui/options.cpp:957 gui/options.cpp:960 gui/options.cpp:964
+#: gui/options.cpp:1054 gui/options.cpp:1060 gui/options.cpp:1066
+#: gui/options.cpp:1074 gui/options.cpp:1098 gui/options.cpp:1102
+#: gui/options.cpp:1108 gui/options.cpp:1115 gui/options.cpp:1214
+#, fuzzy
+msgctxt "path"
 msgid "None"
 msgstr "\xBD\xD5 \xD7\xD0\xD4\xD0\xDD\xD8\xD9"
 
@@ -464,6 +464,13 @@
 msgid "48 kHz"
 msgstr "48 ڳ\xE6"
 
+#: gui/options.cpp:230 gui/options.cpp:399 gui/options.cpp:497
+#: gui/options.cpp:555 gui/options.cpp:733
+#, fuzzy
+msgctxt "soundfont"
+msgid "None"
+msgstr "\xBD\xD5 \xD7\xD0\xD4\xD0\xDD\xD8\xD9"
+
 #: gui/options.cpp:632
 msgid "Graphics mode:"
 msgstr "\xB3\xE0\xD0\xE4\xF6\xE7\xDD\xD8\xD9 \xE0\xD5\xD6\xD8\xDC:"

Modified: scummvm/trunk/tools/create_translations/create_translations.cpp
===================================================================
--- scummvm/trunk/tools/create_translations/create_translations.cpp	2010-08-23 19:44:39 UTC (rev 52307)
+++ scummvm/trunk/tools/create_translations/create_translations.cpp	2010-08-23 19:45:14 UTC (rev 52308)
@@ -35,7 +35,7 @@
 #include "create_translations.h"
 #include "po_parser.h"
 
-#define TRANSLATIONS_DAT_VER 1	// 1 byte
+#define TRANSLATIONS_DAT_VER 2	// 1 byte
 
 // Padding buffer (filled with 0) used if we want to aligned writes
 // static uint8 padBuf[DATAALIGNMENT];
@@ -125,7 +125,6 @@
 	//   ...
 	
 	// Write length for translation description
-	// Each description
 	len = 0;
 	for (lang = 0; lang < numLangs; lang++) {
 		len += stringSize(translations[lang]->language());
@@ -147,8 +146,10 @@
 	// the string size (two bytes for the number of chars and the string itself).
 	for (lang = 0; lang < numLangs; lang++) {
 		len = 2 + stringSize(translations[lang]->charset());
-		for (i = 0; i < translations[lang]->size(); ++i)
+		for (i = 0; i < translations[lang]->size(); ++i) {
 			len += 2 + stringSize(translations[lang]->entry(i)->msgstr);
+			len += stringSize(translations[lang]->entry(i)->msgctxt);
+		}
 		writeUint16BE(outFile, len);
 	}
 
@@ -171,6 +172,7 @@
 		for (i = 0; i < translations[lang]->size(); ++i) {
 			writeUint16BE(outFile, messageIds.findIndex(translations[lang]->entry(i)->msgid));
 			writeString(outFile, translations[lang]->entry(i)->msgstr);
+			writeString(outFile, translations[lang]->entry(i)->msgctxt);
 		}
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list