Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kf6-ki18n for openSUSE:Factory checked in at 2026-02-16 13:02:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kf6-ki18n (Old) and /work/SRC/openSUSE:Factory/.kf6-ki18n.new.1977 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kf6-ki18n" Mon Feb 16 13:02:11 2026 rev:25 rq:1332931 version:6.23.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kf6-ki18n/kf6-ki18n.changes 2026-01-12 10:15:46.567813547 +0100 +++ /work/SRC/openSUSE:Factory/.kf6-ki18n.new.1977/kf6-ki18n.changes 2026-02-16 13:05:25.860351586 +0100 @@ -1,0 +2,15 @@ +Fri Feb 6 14:25:52 UTC 2026 - Christophe Marin <[email protected]> + +- Update to 6.23.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/6/6.23.0 +- Changes since 6.22.0: + * Update dependency version to 6.23.0 + * tests: fix asan mem leak in klocalizedstringtest + * fixup! qml: introduce KI18nContext + * qml: introduce KI18nContext + * Add another explicit moc include to source file for moc-covered header + * Update version to 6.23.0 + +------------------------------------------------------------------- Old: ---- ki18n-6.22.0.tar.xz ki18n-6.22.0.tar.xz.sig New: ---- ki18n-6.23.0.tar.xz ki18n-6.23.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kf6-ki18n.spec ++++++ --- /var/tmp/diff_new_pack.3qMCio/_old 2026-02-16 13:05:27.268409951 +0100 +++ /var/tmp/diff_new_pack.3qMCio/_new 2026-02-16 13:05:27.268409951 +0100 @@ -19,11 +19,11 @@ %define qt6_version 6.8.0 %define rname ki18n -# Full KF6 version (e.g. 6.22.0) +# Full KF6 version (e.g. 6.23.0) %{!?_kf6_version: %global _kf6_version %{version}} %bcond_without released Name: kf6-ki18n -Version: 6.22.0 +Version: 6.23.0 Release: 0 Summary: KDE Gettext-based UI text internationalization License: LGPL-2.1-or-later ++++++ ki18n-6.22.0.tar.xz -> ki18n-6.23.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-6.22.0/CMakeLists.txt new/ki18n-6.23.0/CMakeLists.txt --- old/ki18n-6.22.0/CMakeLists.txt 2026-01-02 18:42:00.000000000 +0100 +++ new/ki18n-6.23.0/CMakeLists.txt 2026-02-06 13:14:33.000000000 +0100 @@ -1,11 +1,11 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.27) -set(KF_VERSION "6.22.0") # handled by release scripts +set(KF_VERSION "6.23.0") # handled by release scripts project(KI18n VERSION ${KF_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 6.22.0 NO_MODULE) +find_package(ECM 6.23.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-6.22.0/autotests/klocalizedstringtest.cpp new/ki18n-6.23.0/autotests/klocalizedstringtest.cpp --- old/ki18n-6.22.0/autotests/klocalizedstringtest.cpp 2026-01-02 18:42:00.000000000 +0100 +++ new/ki18n-6.23.0/autotests/klocalizedstringtest.cpp 2026-02-06 13:14:33.000000000 +0100 @@ -561,10 +561,12 @@ const auto prevLangs = qgetenv("LANGUAGE"); qputenv("LANGUAGE", "fr_FR"); QCOMPARE(i18n("Job"), "Job"_L1); - QCoreApplication::sendEvent(QCoreApplication::instance(), new QEvent(QEvent::LanguageChange)); + std::unique_ptr<QEvent> languageChangeEvent(new QEvent(QEvent::LanguageChange)); + QCoreApplication::sendEvent(QCoreApplication::instance(), languageChangeEvent.get()); QCOMPARE(i18n("Job"), u"Tâche"); qputenv("LANGUAGE", prevLangs); - QCoreApplication::sendEvent(QCoreApplication::instance(), new QEvent(QEvent::LanguageChange)); + languageChangeEvent.reset(new QEvent(QEvent::LanguageChange)); + QCoreApplication::sendEvent(QCoreApplication::instance(), languageChangeEvent.get()); QCOMPARE(i18n("Job"), "Job"_L1); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-6.22.0/src/i18n-qml/klocalizedqmlcontext.cpp new/ki18n-6.23.0/src/i18n-qml/klocalizedqmlcontext.cpp --- old/ki18n-6.22.0/src/i18n-qml/klocalizedqmlcontext.cpp 2026-01-02 18:42:00.000000000 +0100 +++ new/ki18n-6.23.0/src/i18n-qml/klocalizedqmlcontext.cpp 2026-02-06 13:14:33.000000000 +0100 @@ -17,6 +17,62 @@ #include "ki18n_qml_logging.h" +namespace +{ +/*! + \internal + \brief Watches for QCoreApplication::languageChange() events and notifies + QML engines to re-evaluate their bindings. +*/ +class LanguageChangeWatcher : public QObject +{ + Q_OBJECT +public: + /*! + \brief Registers a QML engine to be notified on language change events. + + \a engine The engine to notify. + + If the engine is already registered, this is a no-op. + */ + void hello(const QPointer<QQmlEngine> &engine) + { + Q_ASSERT(QThread::currentThread() == QCoreApplication::instance()->thread()); + if (!engine) { + return; + } + + if (!engines.contains(engine)) { + engines.push_back(engine); + qCDebug(KI18N) << "registered engine" << engine << "engines:" << engines; + } + } + + bool eventFilter(QObject *watched, QEvent *event) override + { + if (event->type() == QEvent::LanguageChange && watched == QCoreApplication::instance()) { + // For simplicity we don't have Contexts say bye to us (would require refcounting). + // Instead we always make sure we only operate on living engines. + engines.removeIf([](const auto &engine) { + return !engine; + }); + for (const auto &engine : std::as_const(engines)) { + qCDebug(KI18N) << "triggering binding reevaluation for engine" << engine; + // run this deferred so we can be sure other things have reacted, such as KLocalizedString + // having updated its internal caches + QMetaObject::invokeMethod(engine, &QQmlEngine::retranslate, Qt::QueuedConnection); + } + } + return QObject::eventFilter(watched, event); + } + +private: + QList<QPointer<QQmlEngine>> engines; +}; + +LanguageChangeWatcher s_watcher; +} // namespace + class KLocalizedQmlContextPrivate { public: @@ -38,7 +94,14 @@ : QObject(parent) , d(new KLocalizedQmlContextPrivate) { - QCoreApplication::instance()->installEventFilter(this); + static bool filtered = [] { + QCoreApplication::instance()->installEventFilter(&s_watcher); + return true; + }(); + Q_UNUSED(filtered); + + auto engine = qmlEngine(this); + s_watcher.hello(engine ? engine : qobject_cast<QQmlEngine *>(parent) /* the global context has the engine as parent */); } KLocalizedQmlContext::~KLocalizedQmlContext() = default; @@ -608,19 +671,6 @@ return trMessage.toString(); } -bool KLocalizedQmlContext::eventFilter(QObject *watched, QEvent *event) -{ - if (event->type() == QEvent::LanguageChange && watched == QCoreApplication::instance()) { - qCDebug(KI18N) << "triggering binding reevaluation"; - // run this deferred so we can be sure other things have reacted, such as KLocalizedString - // having updated its internal caches - if (auto engine = qmlEngine(this); engine) { - QMetaObject::invokeMethod(engine, &QQmlEngine::retranslate, Qt::QueuedConnection); - } - } - return QObject::eventFilter(watched, event); -} - KLocalizedQmlContext *KLocalization::Internal::createLocalizedContext(QQmlEngine *engine) { auto ctx = new KLocalizedQmlContext(engine); @@ -629,4 +679,5 @@ return ctx; } +#include "klocalizedqmlcontext.moc" #include "moc_klocalizedqmlcontext.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-6.22.0/src/i18n-qml/klocalizedqmlcontext.h new/ki18n-6.23.0/src/i18n-qml/klocalizedqmlcontext.h --- old/ki18n-6.22.0/src/i18n-qml/klocalizedqmlcontext.h 2026-01-02 18:42:00.000000000 +0100 +++ new/ki18n-6.23.0/src/i18n-qml/klocalizedqmlcontext.h 2026-02-06 13:14:33.000000000 +0100 @@ -12,6 +12,7 @@ #include <QObject> #include <QVariant> +#include <QtQmlIntegration> #include <memory> class QQmlEngine; @@ -86,6 +87,30 @@ } \endqml */ + +/*! + \qmltype KI18nContext + \since 6.23 + \nativetype KLocalizedQmlContext + \inherits KI18n + \inqmlmodule org.kde.ki18n + \brief Creatable variant of KI18n + + \sa KI18n + \sa KLocalizedQmlContext::KLocalizedQmlContext() + + 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: + + \qml + readonly property KI18nContext libI18n: KI18nContext { + translationDomain: "librocketship" + } + text: libI18n.i18nc("@title", "Welcome to Space") + \endqml +*/ class KI18NQML_EXPORT KLocalizedQmlContext : public QObject { Q_OBJECT @@ -97,8 +122,16 @@ * in an application there is no need to set the translation domain as the application's * domain can be used. */ + /*! + \qmlproperty string KI18nContext::translationDomain + + The translation domain to use for this context. This must be explicitly set for the KI18nContext to be functional. + */ Q_PROPERTY(QString translationDomain READ translationDomain WRITE setTranslationDomain NOTIFY translationDomainChanged) + QML_ELEMENT + QML_NAMED_ELEMENT(KI18nContext) + public: /*! * @@ -434,7 +467,6 @@ void translationDomainChanged(const QString &translationDomain); private: - bool eventFilter(QObject *watched, QEvent *event) override; std::unique_ptr<KLocalizedQmlContextPrivate> const d; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-6.22.0/src/i18n-qml/localizedcontext.cpp new/ki18n-6.23.0/src/i18n-qml/localizedcontext.cpp --- old/ki18n-6.22.0/src/i18n-qml/localizedcontext.cpp 2026-01-02 18:42:00.000000000 +0100 +++ new/ki18n-6.23.0/src/i18n-qml/localizedcontext.cpp 2026-02-06 13:14:33.000000000 +0100 @@ -14,3 +14,5 @@ } return context; } + +#include "moc_localizedcontext.cpp"
