Now you can enter "1 minute" and it will be parsed correctly
Details
- Reviewers
zzag - Group Reviewers
Plasma - Commits
- R119:78ccc2eba9cb: [KCMs/Night Color] Add a valueForText handler for the new SpinBox
Enter "1 minute" and tab away from the box
Diff Detail
- Repository
- R119 Plasma Desktop
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
kcms/nightcolor/package/contents/ui/main.qml | ||
---|---|---|
319 | Hmm, does parseInt take the user's locale into account? |
Uh, I don't use Ukrainian locale. However, it doesn't matter that much. We format numbers practically the same way as in en_US.
Given the current implementation of textFromValue and the fact that the maximum value of transTimeField is capped, this change is good to go. However, it would be great to respect the user's locale.
I agree. Since there are other textFromValue implementations in plasma-desktop that don't do this, it would probably make sense to do them all at once. I'll see if I can figure out how.
Looks like parseInt() won't work for non-ASCII digits and for languages where the number of minutes does not come first in the phrase, see Sinhala language:
ro Romanian : %1 minute ru Russian : %1 минуты gd Scottish Gaelic : %1 m(h)ionaid(ean) sr Serbian : %1 минута si Sinhala : මිනිත්තු %1
( found here: https://l10n.kde.org/dictionary/compare-translations.php?package=frameworks&filename=kdelibs4support.po&compare=%251+minutes )
Examples of non-ASCII digits:
Original Message: Every 30 Minutes Farsi (Persian) : هر ۳۰ دقیقه Khmer : រៀងរាល់ ៣០ នាទី Nepali : प्रत्येक ३० मिनेटमा
( found here: https://l10n.kde.org/dictionary/compare-translations.php?package=applications&filename=autorefresh.po&compare=Every+30+Minutes )