summaryrefslogtreecommitdiff
path: root/shared/localization.h
diff options
context:
space:
mode:
Diffstat (limited to 'shared/localization.h')
-rw-r--r--shared/localization.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/shared/localization.h b/shared/localization.h
new file mode 100644
index 00000000..2a5ee80d
--- /dev/null
+++ b/shared/localization.h
@@ -0,0 +1,62 @@
+#ifndef MISC_H_INCLUDED
+#define MISC_H_INCLUDED
+
+#include <wx/intl.h>
+#include <vector>
+#include <memory>
+
+class Translation;
+
+
+namespace FreeFileSync
+{
+ //language dependent global variables: need to be initialized by CustomLocale on program startup and language switch
+
+ extern const wxChar* THOUSANDS_SEPARATOR;
+ extern const wxChar* DECIMAL_POINT;
+
+
+ struct LocInfoLine
+ {
+ int languageID;
+ wxString languageName;
+ wxString languageFile;
+ wxString translatorName;
+ wxString languageFlag;
+ };
+
+ class LocalizationInfo
+ {
+ public:
+ static const std::vector<LocInfoLine>& getMapping();
+
+ private:
+ LocalizationInfo();
+
+ std::vector<LocInfoLine> locMapping;
+ };
+
+
+ class CustomLocale : public wxLocale
+ {
+ public:
+ static CustomLocale& getInstance();
+
+ void setLanguage(const int language);
+
+ int getLanguage() const
+ {
+ return currentLanguage;
+ }
+
+ virtual const wxChar* GetString(const wxChar* szOrigString, const wxChar* szDomain = NULL) const;
+
+ private:
+ CustomLocale();
+
+ std::auto_ptr<Translation> translationDB;
+ int currentLanguage;
+ };
+}
+
+#endif // MISC_H_INCLUDED
bgstack15