Pages
API Documentation
On this page

KI18nContext QML Type

Creatable variant of KI18n. This type was introduced in Qt 6.23. More...

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, 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.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.