diff options
author | Thierry Crozat | 2010-08-23 19:45:14 +0000 |
---|---|---|
committer | Thierry Crozat | 2010-08-23 19:45:14 +0000 |
commit | bc821136fdf2c82c1877c8ae0e607bcbe784dab1 (patch) | |
tree | 848141a4994e5bd13e8a7a9a304777e251927468 /gui | |
parent | 45a87ffe3fb76ae4e75d97271c0567809bd088d0 (diff) | |
download | scummvm-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
Diffstat (limited to 'gui')
-rw-r--r-- | gui/launcher.cpp | 6 | ||||
-rw-r--r-- | gui/options.cpp | 34 | ||||
-rw-r--r-- | gui/themes/translations.dat | bin | 72771 -> 73828 bytes |
3 files changed, 20 insertions, 20 deletions
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 Binary files differindex 9697e75be0..bafc4538bd 100644 --- a/gui/themes/translations.dat +++ b/gui/themes/translations.dat |