aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-06-15 19:20:58 +0000
committerJohannes Schickel2010-06-15 19:20:58 +0000
commit49463c2bf95f8293746f2b6cb9420f313c6babf3 (patch)
tree54a2678f2e3d5cb20ad7b070b961605d9a9dc2a3
parent7360bea1ee55443c14639c13bc0b548bb941a705 (diff)
downloadscummvm-rg350-49463c2bf95f8293746f2b6cb9420f313c6babf3.tar.gz
scummvm-rg350-49463c2bf95f8293746f2b6cb9420f313c6babf3.tar.bz2
scummvm-rg350-49463c2bf95f8293746f2b6cb9420f313c6babf3.zip
Use USE_TRANSLATION, USE_DETECTLANG and USE_TERMCONV instead of (ENABLE_)TRANSLATION, DETECTLANG and TERMCONV.
svn-id: r49885
-rw-r--r--common/module.mk2
-rw-r--r--common/translation.cpp40
-rw-r--r--common/translation.h8
-rwxr-xr-xconfigure8
-rw-r--r--gui/options.cpp12
5 files changed, 35 insertions, 35 deletions
diff --git a/common/module.mk b/common/module.mk
index 857fb10edf..7a1f83c995 100644
--- a/common/module.mk
+++ b/common/module.mk
@@ -29,7 +29,7 @@ MODULE_OBJS := \
xmlparser.o \
zlib.o
-ifdef ENABLE_TRANSLATION
+ifdef USE_TRANSLATION
common/translation.cpp: common/messages.cpp
common/messages.cpp: $(wildcard po/*.po)
diff --git a/common/translation.cpp b/common/translation.cpp
index 791958b911..3119c074ab 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -26,28 +26,28 @@
DECLARE_SINGLETON(Common::TranslationManager)
-#ifdef DETECTLANG
+#ifdef USE_DETECTLANG
#include <locale.h>
#endif
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
#include <langinfo.h>
#endif
-#ifdef TRANSLATION
+#ifdef USE_TRANSLATION
#include "messages.cpp"
#endif
namespace Common {
-#ifdef TRANSLATION
+#ifdef USE_TRANSLATION
// Translation enabled
TranslationManager::TranslationManager() {
-#ifdef DETECTLANG
+#ifdef USE_DETECTLANG
// Activating current locale settings
const char *locale = setlocale(LC_ALL, "");
@@ -74,25 +74,25 @@ TranslationManager::TranslationManager() {
_syslang = String(locale, length);
}
-#else // DETECTLANG
+#else // USE_DETECTLANG
_syslang = "C";
-#endif // DETECTLANG
+#endif // USE_DETECTLANG
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
_convmsg = NULL;
_conversion = NULL;
-#endif // TERMCONV
+#endif // USE_TERMCONV
// Set the default language
setLanguage("");
}
TranslationManager::~TranslationManager() {
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
iconv_close(_conversion);
if (_convmsg)
delete[] _convmsg;
-#endif // TERMCONV
+#endif // USE_TERMCONV
}
void TranslationManager::setLanguage(const char *lang) {
@@ -101,7 +101,7 @@ void TranslationManager::setLanguage(const char *lang) {
else
po2c_setlang(lang);
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
// Get the locale character set (for terminal output)
const char *charset_term = nl_langinfo(CODESET);
@@ -114,7 +114,7 @@ void TranslationManager::setLanguage(const char *lang) {
// Initialize the conversion
_conversion = iconv_open(charset_term, charset_po);
-#endif // TERMCONV
+#endif // USE_TERMCONV
}
const char *TranslationManager::getTranslation(const char *message) {
@@ -125,7 +125,7 @@ String TranslationManager::getTranslation(const String &message) {
return po2c_gettext(message.c_str());
}
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
bool TranslationManager::convert(const char *message) {
// Preparing conversion origin
size_t len = strlen(message);
@@ -154,10 +154,10 @@ bool TranslationManager::convert(const char *message) {
return result != ((size_t)-1);
}
-#endif // TERMCONV
+#endif // USE_TERMCONV
const char *TranslationManager::convertTerm(const char *message) {
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
size_t len = strlen(message);
if (!_convmsg) {
_sizeconv = len * 2;
@@ -177,9 +177,9 @@ const char *TranslationManager::convertTerm(const char *message) {
}
return _convmsg;
-#else // TERMCONV
+#else // USE_TERMCONV
return message;
-#endif // TERMCONV
+#endif // USE_TERMCONV
}
const TLangArray TranslationManager::getSupportedLanguages() const {
@@ -225,7 +225,7 @@ const char *TranslationManager::getLangById(int id) {
return "";
}
-#else // TRANSLATION
+#else // USE_TRANSLATION
// Translation disabled
@@ -244,6 +244,6 @@ const char *TranslationManager::convertTerm(const char *message) {
return message;
}
-#endif // TRANSLATION
+#endif // USE_TRANSLATION
} // End of namespace Common
diff --git a/common/translation.h b/common/translation.h
index ce65688884..c264eadfd9 100644
--- a/common/translation.h
+++ b/common/translation.h
@@ -28,7 +28,7 @@
#include "common/singleton.h"
#include "common/str-array.h"
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
#include <iconv.h>
#endif
@@ -63,13 +63,13 @@ class TranslationManager : public Singleton<TranslationManager> {
private:
Common::String _syslang;
-#ifdef TERMCONV
+#ifdef USE_TERMCONV
iconv_t _conversion;
char *_convmsg;
int _sizeconv;
bool convert(const char *message);
-#endif // TERMCONV
+#endif // USE_TERMCONV
public:
/**
@@ -147,7 +147,7 @@ public:
#define TransMan Common::TranslationManager::instance()
-#ifdef TRANSLATION
+#ifdef USE_TRANSLATION
#define _(str) TransMan.getTranslation(str)
#define _t(str) TransMan.convertTerm(_(str))
#else
diff --git a/configure b/configure
index 095fbc3ab9..7ccf36ca74 100755
--- a/configure
+++ b/configure
@@ -2323,8 +2323,8 @@ fi
# Check whether to build translation support
#
echo_n "Building translation support... "
-add_to_config_mk_if_yes $_translation 'ENABLE_TRANSLATION = 1'
-add_to_config_h_if_yes $_translation '#define TRANSLATION'
+add_to_config_mk_if_yes $_translation 'USE_TRANSLATION = 1'
+add_to_config_h_if_yes $_translation '#define USE_TRANSLATION'
if test "$_translation" = no ; then
echo "no"
else
@@ -2337,7 +2337,7 @@ EOF
_detectlang=no
cc_check $LDFLAGS $CXXFLAGS && _detectlang=yes
- add_to_config_h_if_yes $_detectlang '#define DETECTLANG'
+ add_to_config_h_if_yes $_detectlang '#define USE_DETECTLANG'
if test "$_detectlang" = yes ; then
echo_n "with runtime language detection, "
@@ -2350,7 +2350,7 @@ EOF
cc_check_no_clean $LDFLAGS $CXXFLAGS && _termconv=yes
cc_check $LDFLAGS $CXXFLAGS -liconv && LIBS="$LIBS -liconv" && _termconv=yes
- add_to_config_h_if_yes $_termconv '#define TERMCONV'
+ add_to_config_h_if_yes $_termconv '#define USE_TERMCONV'
if test "$_termconv" = yes ; then
uses_const=no
cat > $TMPC << EOF
diff --git a/gui/options.cpp b/gui/options.cpp
index 792b99ba22..780670e78b 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -853,12 +853,12 @@ GlobalOptionsDialog::GlobalOptionsDialog()
// TODO: joystick setting
-#ifdef TRANSLATION
+#ifdef USE_TRANSLATION
_guiLanguagePopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.GuiLanguagePopupDesc", _("GUI Language:"), _("Language of ScummVM GUI"));
_guiLanguagePopUp = new PopUpWidget(tab, "GlobalOptions_Misc.GuiLanguagePopup");
-#ifdef DETECTLANG
+#ifdef USE_DETECTLANG
_guiLanguagePopUp->appendEntry(_("<default>"), Common::kTranslationAutodetectId);
-#endif // DETECTLANG
+#endif // USE_DETECTLANG
_guiLanguagePopUp->appendEntry(_("English"), Common::kTranslationBuiltinId);
_guiLanguagePopUp->appendEntry("", 0);
Common::TLangArray languages = TransMan.getSupportedLanguages();
@@ -869,7 +869,7 @@ GlobalOptionsDialog::GlobalOptionsDialog()
}
_guiLanguagePopUp->setSelectedTag(TransMan.parseLanguage(ConfMan.get("gui_language").c_str()));
-#endif // TRANSLATION
+#endif // USE_TRANSLATION
// Activate the first tab
tab->setActiveTab(0);
@@ -977,7 +977,7 @@ void GlobalOptionsDialog::close() {
g_gui.loadNewTheme(g_gui.theme()->getThemeId(), selected);
ConfMan.set("gui_renderer", cfg, _domain);
}
-#ifdef TRANSLATION
+#ifdef USE_TRANSLATION
Common::String oldLang = ConfMan.get("gui_language");
int selLang = _guiLanguagePopUp->getSelectedTag();
@@ -997,7 +997,7 @@ void GlobalOptionsDialog::close() {
error.runModal();
#endif
}
-#endif // TRANSLATION
+#endif // USE_TRANSLATION
}
OptionsDialog::close();