| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/miscellaneous/localization.h`/ |
| 2 | |
| 3 | #ifndef LOCALIZATION_H |
| 4 | #define LOCALIZATION_Hcxx . . $ `src/librssguard/miscellaneous/localization.h:4:9`! |
| 5 | |
| 6 | #include <QLocale> |
| 7 | #include <QObject> |
| 8 | #include <QString> |
| 9 | |
| 10 | struct Languagecxx . . $ Language# { |
| 11 | QStringcxx . . $ QString# m_namecxx . . $ Language#m_name.; |
| 12 | QStringcxx . . $ QString# m_codecxx . . $ Language#m_code.; |
| 13 | }; |
| 14 | |
| 15 | class RSSGUARD_DLLSPECcxx . . $ `<built-in>:525:9`! Localizationcxx . . $ Localization# : public QObjectcxx . . $ QObject# { |
| 16 | Q_OBJECTcxx . . $ Localization#tr(75d9f1c324b4579d). |
| 17 | |
| 18 | public: |
| 19 | // Constructor. |
| 20 | explicit Localizationcxx . . $ Localization#Localization(749de1b6ae65bddd).(QObjectcxx . . $ QObject#* parent = nullptr); |
| 21 | |
| 22 | // Destructor. |
| 23 | virtual ~cxx . . $ Localization#`~Localization`(ced63f7c635d850d).Localizationcxx . . $ Localization#(); |
| 24 | |
| 25 | // Returns code of language that should |
| 26 | // be loaded according to settings. |
| 27 | QStringcxx . . $ QString# desiredLanguagecxx . . $ Localization#desiredLanguage(6ef7b6c27b00b43d).() const; |
| 28 | |
| 29 | // Loads currently active language. |
| 30 | void loadActiveLanguagecxx . . $ Localization#loadActiveLanguage(49f6e7a06ebc5aa8).(); |
| 31 | |
| 32 | // Returns list of installed application localizations. |
| 33 | // This list is used ie. in settings dialog. |
| 34 | QListcxx . . $ QList#<Languagecxx . . $ Language#> installedLanguagescxx . . $ Localization#installedLanguages(14064648a6b45cef).() const; |
| 35 | |
| 36 | // Returns empty string or loaded language |
| 37 | // name if it is really loaded. |
| 38 | QStringcxx . . $ QString# loadedLanguagecxx . . $ Localization#loadedLanguage(6ef7b6c27b00b43d).() const; |
| 39 | |
| 40 | // Returns loaded locale. |
| 41 | QLocalecxx . . $ QLocale# loadedLocalecxx . . $ Localization#loadedLocale(a49c665025854758).() const; |
| 42 | |
| 43 | private: |
| 44 | QStringcxx . . $ QString# m_loadedLanguagecxx . . $ Localization#m_loadedLanguage.; |
| 45 | QLocalecxx . . $ QLocale# m_loadedLocalecxx . . $ Localization#m_loadedLocale.; |
| 46 | }; |
| 47 | |
| 48 | inline QStringcxx . . $ QString# Localizationcxx . . $ Localization#::loadedLanguagecxx . . $ Localization#loadedLanguage(6ef7b6c27b00b43d).() const { |
| 49 | return m_loadedLanguagecxx . . $ QString#QString(132dd6869045752b).; |
| 50 | } |
| 51 | |
| 52 | inline QLocalecxx . . $ QLocale# Localizationcxx . . $ Localization#::loadedLocalecxx . . $ Localization#loadedLocale(a49c665025854758).() const { |
| 53 | return m_loadedLocalecxx . . $ QLocale#QLocale(fc203bde9a41e2bc).; |
| 54 | } |
| 55 | |
| 56 | #endif // LOCALIZATION_H |