D22069: Localize long number strings
Alexander Potashev
noreply at phabricator.kde.org
Mon Jun 24 19:59:08 BST 2019
aspotashev added a comment.
In D22069#485921 <https://phabricator.kde.org/D22069#485921>, @ngraham wrote:
> Actual (ki18n("%1").subs(4.2, 5, 'f', 2).toString()): " 4.20"
> Expected (QString(" 4,20")) : " 4,20"
>
>
> What am I doing wrong?
Oops, I answered without looking at the code.
This subs() call in turn calls QString::arg() overload for double: https://doc.qt.io/qt-5/qstring.html#arg-9
I'm not sure how to interpret this part of Qt documentation, may be the authors meant that "%L1 <https://phabricator.kde.org/L1>".subs(4.2, 5, 'f', 2) would produce locale-aware " 4.20"/" 4,20" and just "%1".subs(... 'f' ...) always uses a decimal **point**.
REPOSITORY
R249 KI18n
REVISION DETAIL
https://phabricator.kde.org/D22069
To: ngraham, #localization, #frameworks, broulik
Cc: aspotashev, ilic, kde-frameworks-devel, broulik, LeGast00n, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190624/e208d191/attachment.html>
More information about the Kde-frameworks-devel
mailing list