KConfigWidgets
klanguagename.cpp
22static std::tuple<QString, QString> namesFromEntryFile(const QString &realCode, const QString &realOutputCode)
43 const QString realOutputCode = outputCode == QLatin1String("en") ? QStringLiteral("en_US") : outputCode;
45 const std::tuple<QString, QString> nameAndEnglishName = namesFromEntryFile(realCode, realOutputCode);
51 // realOutputCode. When it doesn't find it in the locale you ask for, it just returns the english version
52 // so we compare the returned name against the english version, if they are different we return it, if they
53 // are equal we defer to QLocale (with a final fallback to name/englishName if QLocale doesn't know about it)
67 // We get here if QLocale doesn't know about realCode (at the time of writing this happens for crh, csb, hne, mai) and name and englishName are the same.
68 // So what we do here is return name, which can be either empty if the KDE side doesn't know about the code, or otherwise will be the name/englishName
75 const QStringList localeDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("locale"), QStandardPaths::LocateDirectory);
79 return QFile::exists(localeDir + QLatin1Char('/') + language + QLatin1String("/kf6_entry.desktop"));
81 std::copy_if(entries.begin(), entries.end(), std::back_inserter(systemLangList), languageExists);
SimpleConfig
QString name(StandardAction id)
Dirs
QStringList entryList(Filters filters, SortFlags sort) const const
bool exists() const const
const_reference at(qsizetype i) const const
iterator begin()
iterator end()
QLocale c()
QString languageToString(Language language)
QString name() const const
LocateDirectory
GenericDataLocation
QString locate(StandardLocation type, const QString &fileName, LocateOptions options)
QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options)
bool isEmpty() const const
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
qsizetype removeDuplicates()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.