| Summary: | QML: falsey values are considered missing arguments | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-ki18n | Reporter: | Janet Blackquill <uhhadd> |
| Component: | general | Assignee: | Chusslove Illich <caslav.ilic> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kdelibs-bugs-null, me, nate |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/frameworks/ki18n/commit/d72b03c088e4ba0103872d2dc4fd4a33d75c5062 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
I tried to reproduce it with the following code, but I didn't spot any problems with the status quo
import QtQuick.Controls 2.15
import org.kde.kirigami 2.20 as Kirigami
Kirigami.Page {
title: "BUG 451807"
contentItem: Kirigami.FormLayout {
TextField {
text: i18n("i have %1 things", 0)
}
TextField {
text: i18n("i have %1 things", 1)
}
}
}
Git commit d72b03c088e4ba0103872d2dc4fd4a33d75c5062 by Albert Astals Cid. Committed on 30/06/2022 at 22:26. Pushed by aacid into branch 'master'. Accept null strings from QML M +2 -0 autotests/ki18ndeclarativetest.cpp M +3 -0 autotests/test.qml M +10 -10 src/i18n/klocalizedcontext.cpp https://invent.kde.org/frameworks/ki18n/commit/d72b03c088e4ba0103872d2dc4fd4a33d75c5062 |
Falsey values are considered missing arguments; e.g. `0` doesn't count as an argument due to 0 being a falsey value. This results in something like the following not working: i18n("i have %1 things", 0).