File indexing completed on 2024-05-05 05:36:41

0001 /*
0002     SPDX-FileCopyrightText: 2014 Martin Klapetek <mklapetek@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 
0006 */
0007 
0008 #ifndef TIMEZONESI18N_H
0009 #define TIMEZONESI18N_H
0010 
0011 #include <QHash>
0012 #include <QLocale>
0013 #include <QObject>
0014 
0015 class TimezonesI18n : public QObject
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit TimezonesI18n(QObject *parent = nullptr);
0021     Q_INVOKABLE QString i18nCity(const QString &city);
0022     Q_INVOKABLE QString i18nContinents(const QString &continent);
0023     Q_INVOKABLE QString i18nCountry(QLocale::Country country);
0024 
0025 private:
0026     void init();
0027 
0028     QHash<QString, QString> m_i18nCities;
0029     QHash<QString, QString> m_i18nContinents;
0030     QHash<QLocale::Country, QString> m_i18nCountries;
0031     bool m_isInitialized;
0032 };
0033 
0034 #endif // TIMEZONESI18N_H