Add some i18n(), avoid using QString::number() as recommended here:
https://techbase.kde.org/Development/Tutorials/Localization/i18n_Krazy#Number_Formatting
lancaster | |
mutlaqja |
KStars |
Add some i18n(), avoid using QString::number() as recommended here:
https://techbase.kde.org/Development/Tutorials/Localization/i18n_Krazy#Number_Formatting
Only message extraction was tested, no testing of compilation or testing in vivo were performed.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
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.