aboutsummaryrefslogtreecommitdiff
path: root/common
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 /common
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 'common')
-rw-r--r--common/translation.cpp55
-rw-r--r--common/translation.h14
2 files changed, 11 insertions, 58 deletions
diff --git a/common/translation.cpp b/common/translation.cpp
index 69824dd299..47671b3a8d 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -38,6 +38,8 @@
#include "common/fs.h"
#include "common/system.h"
+#ifdef USE_TRANSLATION
+
DECLARE_SINGLETON(Common::TranslationManager);
namespace Common {
@@ -46,10 +48,6 @@ bool operator<(const TLanguage &l, const TLanguage &r) {
return strcmp(l.name, r.name) < 0;
}
-#ifdef USE_TRANSLATION
-
-// Translation enabled
-
TranslationManager::TranslationManager() : _currentLang(-1) {
loadTranslationsInfoDat();
@@ -373,53 +371,6 @@ bool TranslationManager::checkHeader(File &in) {
return true;
}
-#else // USE_TRANSLATION
-
-// Translation disabled
-
-
-TranslationManager::TranslationManager() {}
-
-TranslationManager::~TranslationManager() {}
-
-void TranslationManager::setLanguage(const String &lang) {}
-
-String TranslationManager::getLangById(int id) const {
- return String();
-}
-
-int TranslationManager::parseLanguage(const String &lang) const {
- return kTranslationBuiltinId;
-}
-
-const char *TranslationManager::getTranslation(const char *message) const {
- return message;
-}
-
-String TranslationManager::getTranslation(const String &message) const {
- return message;
-}
-
-const char *TranslationManager::getTranslation(const char *message, const char *) const {
- return message;
-}
-
-String TranslationManager::getTranslation(const String &message, const String &) const {
- return message;
-}
-
-const TLangArray TranslationManager::getSupportedLanguageNames() const {
- return TLangArray();
-}
-
-String TranslationManager::getCurrentCharset() const {
- return "ASCII";
-}
-
-String TranslationManager::getCurrentLanguage() const {
- return "C";
-}
+} // End of namespace Common
#endif // USE_TRANSLATION
-
-} // End of namespace Common
diff --git a/common/translation.h b/common/translation.h
index 18f55d5696..5587d0eb92 100644
--- a/common/translation.h
+++ b/common/translation.h
@@ -28,6 +28,8 @@
#include "common/singleton.h"
#include "common/str-array.h"
+#ifdef USE_TRANSLATION
+
namespace Common {
class File;
@@ -158,7 +160,6 @@ public:
String getCurrentLanguage() const;
private:
-#ifdef USE_TRANSLATION
/**
* Find the translations.dat file. It looks first using the SearchMan and
* then if needed using the Themepath. If found it opens the given File
@@ -197,23 +198,24 @@ private:
Array<PoMessageEntry> _currentTranslationMessages;
String _currentCharset;
int _currentLang;
-#endif
};
} // End of namespace Common
#define TransMan Common::TranslationManager::instance()
-#ifdef USE_TRANSLATION
#define _(str) TransMan.getTranslation(str)
#define _c(str, context) TransMan.getTranslation(str, context)
-#else
+
+#else // !USE_TRANSLATION
+
#define _(str) str
#define _c(str, context) str
-#endif
+
+#endif // USE_TRANSLATION
#define _s(str) str
#define _sc(str, ctxt) str
#define DECLARE_TRANSLATION_ADDITIONAL_CONTEXT(str, ctxt)
-#endif
+#endif // COMMON_TRANSLATION_H