File indexing completed on 2024-11-03 09:51:25
0001 /* 0002 SPDX-FileCopyrightText: 1999-2003 Hans Petter Bieker <bieker@kde.org> 0003 SPDX-FileCopyrightText: 2001 Martijn Klingens <klingens@kde.org> 0004 SPDX-FileCopyrightText: 2007 David Jarvie <software@astrojar.org.uk> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #ifndef KLANGUAGENAME_H 0010 #define KLANGUAGENAME_H 0011 0012 #include "kconfigwidgets_export.h" 0013 0014 #include <QStringList> 0015 0016 class QString; 0017 0018 /** 0019 * @class KLanguageName klanguagename.h KLanguageName 0020 * 0021 * KLanguageName is a helper namespace that returns the name of a given language code. 0022 * 0023 * @since 5.55 0024 * 0025 */ 0026 namespace KLanguageName 0027 { 0028 /** 0029 * Returns the name of the given language code in the current locale. 0030 * 0031 * If it can't be found in the current locale it returns the name in English. 0032 * 0033 * It it can't be found in English either it returns an empty QString. 0034 * 0035 * @param code code (ISO 639-1) of the language whose name is wanted. 0036 */ 0037 KCONFIGWIDGETS_EXPORT QString nameForCode(const QString &code); 0038 0039 /** 0040 * Returns the name of the given language code in the other given locale code. 0041 * 0042 * If it can't be found in the given locale it returns the name in English. 0043 * 0044 * It it can't be found in English either it returns an empty QString. 0045 * 0046 * @param code code (ISO 639-1) of the language whose name is wanted. 0047 * @param outputLocale code (ISO 639-1) of the language in which we want the name in. 0048 */ 0049 KCONFIGWIDGETS_EXPORT QString nameForCodeInLocale(const QString &code, const QString &outputLocale); 0050 0051 /** 0052 * Returns the list of language codes found on the system. 0053 * 0054 * @since 5.74 0055 */ 0056 KCONFIGWIDGETS_EXPORT QStringList allLanguageCodes(); 0057 } 0058 0059 #endif