Bug 451807 - QML: falsey values are considered missing arguments
Summary: QML: falsey values are considered missing arguments
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ki18n
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Chusslove Illich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-22 22:37 UTC by Janet Blackquill
Modified: 2022-06-30 22:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janet Blackquill 2022-03-22 22:37:59 UTC
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).
Comment 1 ratijas 2022-06-30 00:08:34 UTC
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)
            }
        }
    }
Comment 2 Albert Astals Cid 2022-06-30 22:33:22 UTC
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