1/*
2 SPDX-FileCopyrightText: 1999-2003 Hans Petter Bieker <bieker@kde.org>
3 SPDX-FileCopyrightText: 2001 Martijn Klingens <klingens@kde.org>
4 SPDX-FileCopyrightText: 2007 David Jarvie <software@astrojar.org.uk>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KLANGUAGENAME_H
10#define KLANGUAGENAME_H
11
12#include "kconfigwidgets_export.h"
13
14#include <QStringList>
15
16class QString;
17
18/*!
19 * \namespace KLanguageName
20 * \inmodule KConfigWidgets
21 *
22 * \brief KLanguageName is a helper namespace that returns the name of a given language code.
23 *
24 * \since 5.55
25 */
26namespace KLanguageName
27{
28/*!
29 * Returns the name of the given language code in the current locale.
30 *
31 * If it can't be found in the current locale it returns the name in English.
32 *
33 * It it can't be found in English either it returns an empty QString.
34 *
35 * \a code code (ISO 639-1) of the language whose name is wanted.
36 */
37KCONFIGWIDGETS_EXPORT QString nameForCode(const QString &code);
38
39/*!
40 * Returns the name of the given language code in the other given locale code.
41 *
42 * If it can't be found in the given locale it returns the name in English.
43 *
44 * It it can't be found in English either it returns an empty QString.
45 *
46 * \a code code (ISO 639-1) of the language whose name is wanted.
47 *
48 * \a outputLocale code (ISO 639-1) of the language in which we want the name in.
49 */
50KCONFIGWIDGETS_EXPORT QString nameForCodeInLocale(const QString &code, const QString &outputLocale);
51
52/*!
53 * Returns the list of language codes found on the system.
54 *
55 * \since 5.74
56 */
57KCONFIGWIDGETS_EXPORT QStringList allLanguageCodes();
58}
59
60#endif
61

source code of kconfigwidgets/src/klanguagename.h