[Scummvm-cvs-logs] SF.net SVN: scummvm:[49885] scummvm/trunk
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Tue Jun 15 21:20:59 CEST 2010
Revision: 49885
http://scummvm.svn.sourceforge.net/scummvm/?rev=49885&view=rev
Author: lordhoto
Date: 2010-06-15 19:20:58 +0000 (Tue, 15 Jun 2010)
Log Message:
-----------
Use USE_TRANSLATION, USE_DETECTLANG and USE_TERMCONV instead of (ENABLE_)TRANSLATION, DETECTLANG and TERMCONV.
Modified Paths:
--------------
scummvm/trunk/common/module.mk
scummvm/trunk/common/translation.cpp
scummvm/trunk/common/translation.h
scummvm/trunk/configure
scummvm/trunk/gui/options.cpp
Modified: scummvm/trunk/common/module.mk
===================================================================
--- scummvm/trunk/common/module.mk 2010-06-15 18:42:08 UTC (rev 49884)
+++ scummvm/trunk/common/module.mk 2010-06-15 19:20:58 UTC (rev 49885)
@@ -29,7 +29,7 @@
xmlparser.o \
zlib.o
-ifdef ENABLE_TRANSLATION
+ifdef USE_TRANSLATION
common/translation.cpp: common/messages.cpp
common/messages.cpp: $(wildcard po/*.po)
Modified: scummvm/trunk/common/translation.cpp
===================================================================
--- scummvm/trunk/common/translation.cpp 2010-06-15 18:42:08 UTC (rev 49884)
+++ scummvm/trunk/common/translation.cpp 2010-06-15 19:20:58 UTC (rev 49885)
@@ -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 @@
_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 @@
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 @@
// 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 @@
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 @@
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 @@
}
return _convmsg;
-#else // TERMCONV
+#else // USE_TERMCONV
return message;
-#endif // TERMCONV
+#endif // USE_TERMCONV
}
const TLangArray TranslationManager::getSupportedLanguages() const {
@@ -225,7 +225,7 @@
return "";
}
-#else // TRANSLATION
+#else // USE_TRANSLATION
// Translation disabled
@@ -244,6 +244,6 @@
return message;
}
-#endif // TRANSLATION
+#endif // USE_TRANSLATION
} // End of namespace Common
Modified: scummvm/trunk/common/translation.h
===================================================================
--- scummvm/trunk/common/translation.h 2010-06-15 18:42:08 UTC (rev 49884)
+++ scummvm/trunk/common/translation.h 2010-06-15 19:20:58 UTC (rev 49885)
@@ -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 @@
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 @@
#define TransMan Common::TranslationManager::instance()
-#ifdef TRANSLATION
+#ifdef USE_TRANSLATION
#define _(str) TransMan.getTranslation(str)
#define _t(str) TransMan.convertTerm(_(str))
#else
Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure 2010-06-15 18:42:08 UTC (rev 49884)
+++ scummvm/trunk/configure 2010-06-15 19:20:58 UTC (rev 49885)
@@ -2323,8 +2323,8 @@
# 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 @@
_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 @@
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
Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp 2010-06-15 18:42:08 UTC (rev 49884)
+++ scummvm/trunk/gui/options.cpp 2010-06-15 19:20:58 UTC (rev 49885)
@@ -853,12 +853,12 @@
// 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 @@
}
_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 @@
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 @@
error.runModal();
#endif
}
-#endif // TRANSLATION
+#endif // USE_TRANSLATION
}
OptionsDialog::close();
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