aboutsummaryrefslogtreecommitdiff
path: root/common/translation.h
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-19 11:46:55 +0000
committerEugene Sandulenko2010-08-19 11:46:55 +0000
commit040dfff8ce1eec4754c606b393fc4542db78c6d5 (patch)
tree23ef0e89fd70dd68a7feaf1018723d81db37f7dc /common/translation.h
parentaa3cefa2c6826ab250562e60423890b0ebe93318 (diff)
downloadscummvm-rg350-040dfff8ce1eec4754c606b393fc4542db78c6d5.tar.gz
scummvm-rg350-040dfff8ce1eec4754c606b393fc4542db78c6d5.tar.bz2
scummvm-rg350-040dfff8ce1eec4754c606b393fc4542db78c6d5.zip
i18n: Move translations to standalone file. Patch #3044975
svn-id: r52208
Diffstat (limited to 'common/translation.h')
-rw-r--r--common/translation.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/common/translation.h b/common/translation.h
index ccdd0f3500..cefe99ef13 100644
--- a/common/translation.h
+++ b/common/translation.h
@@ -27,6 +27,7 @@
#include "common/singleton.h"
#include "common/str-array.h"
+#include "common/file.h"
namespace Common {
@@ -52,6 +53,11 @@ struct TLanguage {
typedef Array<TLanguage> TLangArray;
+struct PoMessageEntry {
+ int msgid;
+ String msgstr;
+};
+
/**
* Message translation manager.
*/
@@ -127,7 +133,31 @@ public:
const char *getCurrentCharset();
private:
- Common::String _syslang;
+#ifdef USE_TRANSLATION
+ /**
+ * Load the list of languages from the translations.dat file
+ */
+ void loadTranslationsInfoDat();
+ /**
+ * Load the translation for the given language from the translations.dat file
+ *
+ * @param index of the language in the list of languages
+ */
+ void loadLanguageDat(int);
+ /**
+ * Check the header of the given file to make sure it is a valid translations data file.
+ */
+ bool checkHeader(File&);
+
+ String _syslang;
+ StringArray _langs;
+ StringArray _langNames;
+
+ StringArray _messageIds;
+ Array<PoMessageEntry> _currentTranslationMessages;
+ String _currentCharset;
+ int _currentLang;
+#endif
};
} // End of namespace Common