KI18nContext QML Type

Creatable variant of KI18n. More...

Import Statement: import org.kde.ki18n
Since: 6.23
In C++: KLocalizedQmlContext
Inherits:

KI18n

Properties

Detailed Description

This is a creatable variant of KI18n and may be used to create multiple localized contexts right from within QML. In particular useful when working with multiple translation domains (such as in library use cases).

Unlike the KI18n variant this does not require help from the C++ side and can be used entirely from QML:

readonly property KI18nContext libI18n: KI18nContext {
    translationDomain: "librocketship"
}
text: libI18n.i18nc("@title", "Welcome to Space")

See also KI18n and KLocalizedQmlContext::KLocalizedQmlContext().

Property Documentation

translationDomain : string

The translation domain to use for this context. This must be explicitly set for the KI18nContext to be functional.