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 | |
16 | class QString; |
17 | |
18 | /** |
19 | * @class KLanguageName klanguagename.h KLanguageName |
20 | * |
21 | * KLanguageName is a helper namespace that returns the name of a given language code. |
22 | * |
23 | * @since 5.55 |
24 | * |
25 | */ |
26 | namespace 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 | * @param code code (ISO 639-1) of the language whose name is wanted. |
36 | */ |
37 | KCONFIGWIDGETS_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 | * @param code code (ISO 639-1) of the language whose name is wanted. |
47 | * @param outputLocale code (ISO 639-1) of the language in which we want the name in. |
48 | */ |
49 | KCONFIGWIDGETS_EXPORT QString nameForCodeInLocale(const QString &code, const QString &outputLocale); |
50 | |
51 | /** |
52 | * Returns the list of language codes found on the system. |
53 | * |
54 | * @since 5.74 |
55 | */ |
56 | KCONFIGWIDGETS_EXPORT QStringList allLanguageCodes(); |
57 | } |
58 | |
59 | #endif |
60 | |