D20012: Fix number localization for properties

Stefan BrĂ¼ns noreply at phabricator.kde.org
Sun Mar 24 17:07:00 GMT 2019


bruns added inline comments.

INLINE COMMENTS

> propertyinfotest.cpp:97
>      QCOMPARE(framerate.formatAsDisplayString(QVariant(23)), QStringLiteral("23 fps"));
> -    QCOMPARE(framerate.formatAsDisplayString(QVariant(23.976)), QStringLiteral("23.98 fps"));
> +    QCOMPARE(framerate.formatAsDisplayString(QVariant(23.976)), QString(QLocale().toString(23.98) + QStringLiteral(" fps")));
>  

This will of course fail as soon as someone translates fps, e.g. german "B/s", even more in RTL locales.

Probably the better solution is to provide the whole string verbatim, and mark it with i18n. Until then, tests should be run with an en or C locale.

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D20012

To: astippich, bruns
Cc: kde-frameworks-devel, #baloo, gennad, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190324/994388a2/attachment.html>


More information about the Kde-frameworks-devel mailing list