aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2010-08-23 19:45:14 +0000
committerThierry Crozat2010-08-23 19:45:14 +0000
commitbc821136fdf2c82c1877c8ae0e607bcbe784dab1 (patch)
tree848141a4994e5bd13e8a7a9a304777e251927468
parent45a87ffe3fb76ae4e75d97271c0567809bd088d0 (diff)
downloadscummvm-rg350-bc821136fdf2c82c1877c8ae0e607bcbe784dab1.tar.gz
scummvm-rg350-bc821136fdf2c82c1877c8ae0e607bcbe784dab1.tar.bz2
scummvm-rg350-bc821136fdf2c82c1877c8ae0e607bcbe784dab1.zip
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. svn-id: r52308
-rw-r--r--common/translation.cpp63
-rw-r--r--common/translation.h25
-rw-r--r--gui/launcher.cpp6
-rw-r--r--gui/options.cpp34
-rw-r--r--gui/themes/translations.datbin72771 -> 73828 bytes
-rw-r--r--po/ca_ES.po23
-rw-r--r--po/de_DE.po23
-rw-r--r--po/es_ES.po23
-rw-r--r--po/fr_FR.po25
-rw-r--r--po/hu_HU.po23
-rw-r--r--po/it_IT.po23
-rw-r--r--po/module.mk4
-rw-r--r--po/ru_RU.po27
-rw-r--r--po/scummvm.pot20
-rw-r--r--po/uk_UA.po27
-rw-r--r--tools/create_translations/create_translations.cpp8
16 files changed, 244 insertions, 110 deletions
diff --git a/common/translation.cpp b/common/translation.cpp
index 40a89c6497..063e7a1781 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -29,7 +29,7 @@
#undef ARRAYSIZE
#endif
-#define TRANSLATIONS_DAT_VER 1
+#define TRANSLATIONS_DAT_VER 2
#include "translation.h"
@@ -150,6 +150,10 @@ void TranslationManager::setLanguage(const char *lang) {
}
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 @@ const char *TranslationManager::getTranslation(const char *message) {
while (rightIndex >= leftIndex) {
const int midIndex = (leftIndex + rightIndex) / 2;
- const PoMessageEntry * const m = &_currentTranslationMessages[midIndex];
-
- const int compareResult = strcmp(message, _messageIds[m->msgid].c_str());
-
- if (compareResult == 0)
- return m->msgstr.c_str();
- else if (compareResult < 0)
+ const PoMessageEntry *const m = &_currentTranslationMessages[midIndex];
+
+ int compareResult = strcmp(message, _messageIds[m->msgid].c_str());
+
+ 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 @@ String TranslationManager::getTranslation(const String &message) {
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 @@ void TranslationManager::loadLanguageDat(int index) {
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 @@ String TranslationManager::getTranslation(const String &message) {
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();
}
diff --git a/common/translation.h b/common/translation.h
index ccd35ce288..af33177559 100644
--- a/common/translation.h
+++ b/common/translation.h
@@ -50,6 +50,7 @@ typedef Array<TLanguage> TLangArray;
struct PoMessageEntry {
int msgid;
+ String msgctxt;
String msgstr;
};
@@ -114,6 +115,28 @@ public:
* 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 @@ private:
#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
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index d50e7ce578..47fc0cf5ec 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -286,7 +286,7 @@ void EditGameDialog::open() {
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 @@ void EditGameDialog::close() {
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 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
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);
diff --git a/gui/options.cpp b/gui/options.cpp
index 4969f8ef3f..31be438687 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -227,7 +227,7 @@ void OptionsDialog::open() {
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 @@ void OptionsDialog::close() {
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 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
_subSpeedLabel->draw();
break;
case kClearSoundFontCmd:
- _soundFont->setLabel(_("None"));
+ _soundFont->setLabel(_c("None", "soundfont"));
_soundFontClearButton->setEnabled(false);
draw();
break;
@@ -552,7 +552,7 @@ void OptionsDialog::setMIDISettingsState(bool enabled) {
_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 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
// 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 @@ GlobalOptionsDialog::GlobalOptionsDialog()
_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 @@ void GlobalOptionsDialog::open() {
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 @@ void GlobalOptionsDialog::open() {
#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::open() {
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 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
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);
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index 9697e75be0..bafc4538bd 100644
--- a/gui/themes/translations.dat
+++ b/gui/themes/translations.dat
Binary files differ
diff --git a/po/ca_ES.po b/po/ca_ES.po
index 48f9e27b20..e86916e273 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.po
@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.2.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@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@gmail.com>\n"
"Language-Team: Catalan <scummvm-devel@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 @@ msgid "Specifies where your savegames are put"
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 @@ msgstr "44 kHz"
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àfic:"
diff --git a/po/de_DE.po b/po/de_DE.po
index 59c1bc1bc4..25c32b8665 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.2.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@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@Windowsbase.de> & Simon Sawatzki "
"<SimSaw@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 @@ msgid "Specifies where your savegames are put"
msgstr "Legt fest, wo die Spielstände 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 @@ msgstr "44 kHz"
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:"
diff --git a/po/es_ES.po b/po/es_ES.po
index dafb685bea..a6caf00bbb 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.2.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@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ás 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 @@ msgid "Specifies where your savegames are put"
msgstr "Especifica dónde 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 @@ msgstr "44 kHz"
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áfico:"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index 207edb9b04..27f1f9d4b7 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.2.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@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@scummvm.org>\n"
"Language-Team: French <scummvm-devel@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 @@ msgid "Specifies where your savegames are put"
msgstr "Définie l'emplacement où les fichiers de sauvegarde sont créés"
#: 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 @@ msgstr "44 kHz"
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 @@ msgstr "Voulez-vous exécuter une recherche automatique?"
#~ msgid "%s failed to instantiate engine: %s (target '%s', path '%s')"
#~ msgstr ""
-#~ "Le plugin %s a échoué dans l'instanciation du moteur de jeu: %s (cible '%"
-#~ "s', chemin '%s')"
+#~ "Le plugin %s a échoué dans l'instanciation du moteur de jeu: %s (cible "
+#~ "'%s', chemin '%s')"
#~ msgid "Ok"
#~ msgstr "Ok"
diff --git a/po/hu_HU.po b/po/hu_HU.po
index 344c3040d6..f94e23e929 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM VERSION\n"
"Report-Msgid-Bugs-To: scummvm-devel@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@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 @@ msgid "Specifies where your savegames are put"
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 @@ msgstr ""
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ód:"
diff --git a/po/it_IT.po b/po/it_IT.po
index bb22398b7f..ae0ae3de95 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.2.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@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 @@ msgid "Specifies where your savegames are put"
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 @@ msgstr "44 kHz"
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à:"
diff --git a/po/module.mk b/po/module.mk
index 3690052d54..ad7e5fd47b 100644
--- a/po/module.mk
+++ b/po/module.mk
@@ -2,7 +2,7 @@ POTFILE := $(srcdir)/po/scummvm.pot
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@lists.sf.net -o $(POTFILE)_
@@ -25,7 +25,7 @@ updatepot:
fi;
%.po: $(POTFILE)
- msgmerge -N $@ $(POTFILE) -o $@.new
+ msgmerge $@ $(POTFILE) -o $@.new
if cmp $@ $@.new >/dev/null 2>&1; then \
rm -f $@.new; \
else \
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 0f5510bde1..3ae2942f81 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -7,16 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM VERSION\n"
"Report-Msgid-Bugs-To: scummvm-devel@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@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 @@ msgid "Specifies where your savegames are put"
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 "½Õ ×ÐÔÐÝ"
@@ -462,6 +462,13 @@ msgstr "44 Ú³æ"
msgid "48 kHz"
msgstr "48 Ú³æ"
+#: 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 "³àÐä. àÕÖØÜ:"
diff --git a/po/scummvm.pot b/po/scummvm.pot
index 1581129399..95473cbacd 100644
--- a/po/scummvm.pot
+++ b/po/scummvm.pot
@@ -8,10 +8,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.2.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@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@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@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 @@ msgid "Specifies where your savegames are put"
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 @@ msgstr ""
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 ""
diff --git a/po/uk_UA.po b/po/uk_UA.po
index 3280261909..7d3cc45a26 100644
--- a/po/uk_UA.po
+++ b/po/uk_UA.po
@@ -7,16 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM VERSION\n"
"Report-Msgid-Bugs-To: scummvm-devel@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 @@ msgid "Specifies where your savegames are put"
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 "½Õ ×ÐÔÐÝØÙ"
@@ -464,6 +464,13 @@ msgstr "44 Ú³æ"
msgid "48 kHz"
msgstr "48 Ú³æ"
+#: 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 "³àÐäöçÝØÙ àÕÖØÜ:"
diff --git a/tools/create_translations/create_translations.cpp b/tools/create_translations/create_translations.cpp
index af7dd02f82..fab35cdfd5 100644
--- a/tools/create_translations/create_translations.cpp
+++ b/tools/create_translations/create_translations.cpp
@@ -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 @@ int main(int argc, char *argv[]) {
// ...
// Write length for translation description
- // Each description
len = 0;
for (lang = 0; lang < numLangs; lang++) {
len += stringSize(translations[lang]->language());
@@ -147,8 +146,10 @@ int main(int argc, char *argv[]) {
// 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 @@ int main(int argc, char *argv[]) {
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);
}
}