Fix localization for number of seconds in spinbox
ClosedPublic

Authored by ngraham on Oct 13 2018, 8:35 PM.

Details

Summary

BUG: 399764
FIXED-IN: 18.12.0

Test Plan

Works for English::

0.5 seconds
1 second
1.5 seconds
2 seconds
2.5 seconds
[etc]

Diff Detail

Repository
R166 Spectacle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Oct 13 2018, 8:35 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptOct 13 2018, 8:35 PM
ngraham requested review of this revision.Oct 13 2018, 8:35 PM

Note: I'm not an expert at localization, so I'd appreciate a thorough review from the Localization folks to make sure I did the right thing. Thanks!

This patch works for me. However "static_cast<int>(val)" may be safer and favorable in the majority of coding styles out there.

ngraham updated this revision to Diff 43563.Oct 13 2018, 10:05 PM

Use safer static_cast<int>() instead of plain old int()

aacid added a subscriber: aacid.Oct 14 2018, 10:21 PM

I still maintain this is wrong, and that there is no need for the second i18ncp since we don't support anywhere else different plurals for decimal numbers so we shouldn't here either, and as far as I know we don't support differnt plurals because all languages just use the same form for decimal numbers.

aspotashev added a comment.EditedOct 14 2018, 11:50 PM

Oops, you are right! I somehow missed or forgot about your comment at https://git.reviewboard.kde.org/r/129568/ that Scottish Gaelic uses translation scripting.

The second i18n call can be just i18nc("Decimal number of seconds", " seconds")

ngraham updated this revision to Diff 43630.Oct 15 2018, 2:29 AM

Address review comments

Maybe it be better to use SI abbreviations with decimals?
With SI units we always use the same symbol, it's 1 km, 3.5 km, 0.5 km, etc...

I'm not sure myself though that this would be better, so feel free to ignore this. Just throwing in some idea...

Can this land?

aacid accepted this revision.Oct 17 2018, 5:21 PM

You need a new fixed-in

This revision is now accepted and ready to land.Oct 17 2018, 5:21 PM

You need a new fixed-in

What's wrong with FIXED-IN: 18.12.0? This can't land on the Applications/18.08 branch .

You need a new fixed-in

What's wrong with FIXED-IN: 18.12.0? This can't land on the Applications/18.08 branch .

Nothing, i had read 18.8.0

This revision was automatically updated to reflect the committed changes.