Make Star Profile Viewer localizable
ClosedPublic

Authored by yurchor on Nov 25 2018, 8:10 AM.

Details

Summary

Add some i18n(), avoid using QString::number() as recommended here:

https://techbase.kde.org/Development/Tutorials/Localization/i18n_Krazy#Number_Formatting

Test Plan

Only message extraction was tested, no testing of compilation or testing in vivo were performed.

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
yurchor created this revision.Nov 25 2018, 8:10 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptNov 25 2018, 8:10 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
yurchor requested review of this revision.Nov 25 2018, 8:10 AM
yurchor updated this revision to Diff 46200.Nov 25 2018, 2:43 PM

Fixed to be compilable.

mutlaqja accepted this revision.Nov 25 2018, 2:59 PM
This revision is now accepted and ready to land.Nov 25 2018, 2:59 PM
This revision was automatically updated to reflect the committed changes.

You should use QString("%L1").arg(variable, width, 'f', précision) to properly format floating point values using the decimal point of the locale

According to the document Yuri posted, I think he got it right. The arg method appears to be the old way to do it.

i18n("Found key: %1", key); correct
i18n("Found key: %1").arg(key);
***wrong

Assuming you were talking about his changes here of course, I might misunderstand what you mean

In the case of floating point, either QString("%L1").arg() or ki18n().subs() should be used, and HFR is a float (no i18n with args here).
But I didn't investigate whether, while the QString method systematically used the system locale, the ki18n could handle a locale switch in the application without system locale changes.