diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:09 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:09 +0200 |
commit | 9cc790869ed3905c78c7eeeb0bb44f800b3f2af4 (patch) | |
tree | 1c085bbf2302be294866c4fc6e0d225f8abbc346 /shared/i18n.h | |
parent | 3.14 (diff) | |
download | FreeFileSync-9cc790869ed3905c78c7eeeb0bb44f800b3f2af4.tar.gz FreeFileSync-9cc790869ed3905c78c7eeeb0bb44f800b3f2af4.tar.bz2 FreeFileSync-9cc790869ed3905c78c7eeeb0bb44f800b3f2af4.zip |
3.15
Diffstat (limited to 'shared/i18n.h')
-rw-r--r-- | shared/i18n.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/shared/i18n.h b/shared/i18n.h new file mode 100644 index 00000000..0026cdd5 --- /dev/null +++ b/shared/i18n.h @@ -0,0 +1,58 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef MISC_H_INCLUDED +#define MISC_H_INCLUDED + +#include <wx/string.h> +#include <vector> + +namespace ffs3 +{ +struct LocInfoLine +{ + int languageID; + wxString languageName; + wxString languageFile; + wxString translatorName; + wxString languageFlag; +}; + +class LocalizationInfo +{ +public: + static const std::vector<LocInfoLine>& get(); + +private: + LocalizationInfo(); + LocalizationInfo(const LocalizationInfo&); + LocalizationInfo& operator=(const LocalizationInfo&); + + std::vector<LocInfoLine> locMapping; +}; + + +//language independent global variables: just use operating system's default setting! +wxString getThousandsSeparator(); +wxString getDecimalPoint(); + +void setLanguage(int language); +int getLanguage(); + +int retrieveSystemLanguage(); + +wxString translate(const wxString& original); //translate into currently selected language + +//translate plural forms: "%x day|%x days" +//returns "%x day" if n == 1; "%x days" else for english language +wxString translate(const wxString& original, int n); +} + +//WXINTL_NO_GETTEXT_MACRO must be defined to deactivate wxWidgets underscore macro +#define _(s) ffs3::translate(wxT(s)) +#define _P(s, n) ffs3::translate(wxT(s), n) + +#endif // MISC_H_INCLUDED |