diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:00:17 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:00:17 +0200 |
commit | fd0853d2623dd278b08288331ed42e3be59252fb (patch) | |
tree | a7645daeaef8bdbed064faf4eb88e72cee58726c /shared/localization.h | |
parent | 2.1 (diff) | |
download | FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.tar.gz FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.tar.bz2 FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.zip |
2.2
Diffstat (limited to 'shared/localization.h')
-rw-r--r-- | shared/localization.h | 62 |
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 |