KLanguageName Namespace
KLanguageName is a helper namespace that returns the name of a given language code. More...
Header: | #include <KLanguageName> |
CMake: | find_package(KF6 REQUIRED COMPONENTS ConfigWidgets) target_link_libraries(mytarget PRIVATE KF6::ConfigWidgets) |
Functions
QStringList | allLanguageCodes() |
QString | nameForCode(const QString &code) |
QString | nameForCodeInLocale(const QString &code, const QString &outputLocale) |
Detailed Description
Function Documentation
QStringList KLanguageName::allLanguageCodes()
Returns the list of language codes found on the system.
QString KLanguageName::nameForCode(const QString &code)
Returns the name of the given language code in the current locale.
If it can't be found in the current locale it returns the name in English.
It it can't be found in English either it returns an empty QString.
code code (ISO 639-1) of the language whose name is wanted.
QString KLanguageName::nameForCodeInLocale(const QString &code, const QString &outputLocale)
Returns the name of the given language code in the other given locale code.
If it can't be found in the given locale it returns the name in English.
It it can't be found in English either it returns an empty QString.
code code (ISO 639-1) of the language whose name is wanted.
outputLocale code (ISO 639-1) of the language in which we want the name in.