aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJordi Vilalta Prat2010-11-30 18:50:19 +0000
committerJordi Vilalta Prat2010-11-30 18:50:19 +0000
commit8393bc5b5f2f3e5304cf589c21956676c4bd04c1 (patch)
tree7f4292c824d384fc4be70288d350926ddb1bcb43 /gui
parent3c55c9faf72804e2f2efca0d7b924e2b696e18e8 (diff)
downloadscummvm-rg350-8393bc5b5f2f3e5304cf589c21956676c4bd04c1.tar.gz
scummvm-rg350-8393bc5b5f2f3e5304cf589c21956676c4bd04c1.tar.bz2
scummvm-rg350-8393bc5b5f2f3e5304cf589c21956676c4bd04c1.zip
I18N: Don't build TranslationManager when translation is disabled.
svn-id: r54684
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEngine.cpp2
-rw-r--r--gui/gui-manager.cpp2
-rw-r--r--gui/options.cpp6
3 files changed, 10 insertions, 0 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 6c2a87a7df..beb17b0c88 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -591,7 +591,9 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file) {
FontMan.assignFontToName(file, _texts[textId]->_fontPtr);
}
+#ifdef USE_TRANSLATION
TransMan.setLanguage("C");
+#endif
warning("Failed to load localized font '%s'. Using non-localized font and default GUI language instead", file.c_str());
}
}
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index a8883b793b..af567c65d8 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -64,8 +64,10 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _stateIsSaved(false),
// Clear the cursor
memset(_cursor, 0xFF, sizeof(_cursor));
+#ifdef USE_TRANSLATION
// Enable translation
TransMan.setLanguage(ConfMan.get("gui_language").c_str());
+#endif // USE_TRANSLATION
ConfMan.registerDefault("gui_theme", "scummmodern");
Common::String themefile(ConfMan.get("gui_theme"));
diff --git a/gui/options.cpp b/gui/options.cpp
index b59278a4f1..59346da967 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1313,9 +1313,12 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
Common::String theme = browser.getSelected();
// FIXME: Actually, any changes (including the theme change) should
// only become active *after* the options dialog has closed.
+#ifdef USE_TRANSLATION
Common::String lang = TransMan.getCurrentLanguage();
+#endif
Common::String oldTheme = g_gui.theme()->getThemeId();
if (g_gui.loadNewTheme(theme)) {
+#ifdef USE_TRANSLATION
// If the charset has changed, it means the font were not found for the
// new theme. Since for the moment we do not support change of translation
// language without restarting, we let the user know about this.
@@ -1325,9 +1328,12 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
MessageDialog error(_("The theme you selected does not support your current language. If you want to use this theme you need to switch to another language first."));
error.runModal();
} else {
+#endif
_curTheme->setLabel(g_gui.theme()->getThemeName());
ConfMan.set("gui_theme", theme);
+#ifdef USE_TRANSLATION
}
+#endif
}
draw();
}