summaryrefslogtreecommitdiff
path: root/library/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'library/misc.h')
-rw-r--r--library/misc.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/library/misc.h b/library/misc.h
new file mode 100644
index 00000000..a8db4088
--- /dev/null
+++ b/library/misc.h
@@ -0,0 +1,52 @@
+#ifndef MISC_H_INCLUDED
+#define MISC_H_INCLUDED
+
+#include <wx/string.h>
+#include <set>
+#include <wx/intl.h>
+
+using namespace std;
+
+struct TranslationLine
+{
+ wxString original;
+ wxString translation;
+
+ bool operator>(const TranslationLine& b ) const
+ {
+ return (original > b.original);
+ }
+ bool operator<(const TranslationLine& b) const
+ {
+ return (original < b.original);
+ }
+ bool operator==(const TranslationLine& b) const
+ {
+ return (original == b.original);
+ }
+};
+typedef set<TranslationLine> Translation;
+
+
+class CustomLocale : public wxLocale
+{
+public:
+ CustomLocale();
+
+ ~CustomLocale();
+
+ void loadLanguageFromCfg();
+ void loadLanguageFile(int language);
+ int getLanguage()
+ {
+ return currentLanguage;
+ }
+
+ const wxChar* GetString(const wxChar* szOrigString, const wxChar* szDomain = NULL) const;
+
+private:
+ Translation translationDB;
+ int currentLanguage;
+};
+
+#endif // MISC_H_INCLUDED
bgstack15