Review Request 127800: Format number in KLocalizedString::subs
Kai Uwe Broulik
kde at privat.broulik.de
Sun May 1 17:18:10 UTC 2016
> On Mai 1, 2016, 4:40 nachm., Chusslove Illich wrote:
> > To have localized numbers is the expected behavior (and documented as such). But it was "temporarily" disabled between kdelibs and KF5, until replacements for KLocale were decided. I don't remember why I didn't switch to %L1 at that moment, since it was available too... Well, I guess best to commit this and see later if there is any trouble.
> >
> > Did you run unit tests? Could be some of them needs adapting.
>
> Kai Uwe Broulik wrote:
> The unit tests fail (2 out of 4) locally both with and without this patch.
>
> Chusslove Illich wrote:
> Hm, and which are these failing tests? When I run them, they all pass (including expected fails).
>
> With the patch, I had to change in autotests/klocalizedstringtest.cpp one comparison literal from " 4.20" to " 4,20".
Ah, they pass, but only if I run them with LANG=en_US
```
FAIL! : KI18nDeclarativeTest::testLocalizedContext(plural translation with domain) Compared values are not the same
Actual (object->property(propertyName.toUtf8().constData()).toString()): "In 3 Sekunden"
Expected (value) : "in 3 seconds"
Loc: [/home/kaiuwe/Projekte/kf5/src/frameworks/ki18n/autotests/ki18ndeclarativetest.cpp(60)]
FAIL! : KLocalizedStringTest::semanticTags() Compared values are not the same
Actual (xi18nc("@info", "Apply color scheme <resource>%1</resource>?", "XXX")): "<html>Apply color scheme \u201EXXX\u201C?</html>"
Expected (QString("<html>Apply color scheme “XXX”?</html>")) : "<html>Apply color scheme \u201CXXX\u201D?</html>"
Loc: [/home/kaiuwe/Projekte/kf5/src/frameworks/ki18n/autotests/klocalizedstringtest.cpp(351)]
```
- Kai Uwe
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127800/#review95056
-----------------------------------------------------------
On April 30, 2016, 10:47 nachm., Kai Uwe Broulik wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127800/
> -----------------------------------------------------------
>
> (Updated April 30, 2016, 10:47 nachm.)
>
>
> Review request for KDE Frameworks.
>
>
> Repository: ki18n
>
>
> Description
> -------
>
> Use %L1 instead of %1 which tells it it's a number.
>
> This way I get decimal indicator and thousands separators according to my locale in eg. KUnitConversion
>
>
> Diffs
> -----
>
> src/klocalizedstring.cpp fc80135
>
> Diff: https://git.reviewboard.kde.org/r/127800/diff/
>
>
> Testing
> -------
>
> 0,00094697205065430554 Meilen and 1.524 Millimeter
> instead of
> 0.00094697205065430554 Meilen and 1524 Millimeter
>
>
> Thanks,
>
> Kai Uwe Broulik
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160501/6290aaf9/attachment.html>
More information about the Kde-frameworks-devel
mailing list