File indexing completed on 2024-12-15 03:45:03
0001 /* 0002 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #include "localeinfosource.h" 0008 0009 #include <QLocale> 0010 #include <QVariant> 0011 0012 using namespace KUserFeedback; 0013 0014 LocaleInfoSource::LocaleInfoSource() 0015 : AbstractDataSource(QStringLiteral("locale")) 0016 { 0017 } 0018 0019 QString LocaleInfoSource::description() const 0020 { 0021 return tr("The current region and language settings."); 0022 } 0023 0024 QVariant LocaleInfoSource::data() 0025 { 0026 QLocale l; 0027 QVariantMap m; 0028 m.insert(QStringLiteral("region"), QLocale::countryToString(l.country())); 0029 m.insert(QStringLiteral("language"), QLocale::languageToString(l.language())); 0030 return m; 0031 } 0032 0033 QString LocaleInfoSource::name() const 0034 { 0035 return tr("Locale information"); 0036 }