Bug 513640

Summary: Improve i18n for spin boxes
Product: [Applications] LabPlot2 Reporter: Emir SARI <emir_sari>
Component: generalAssignee: Stefan Gerlach <stefan.gerlach>
Status: REPORTED ---    
Severity: normal CC: stefan.gerlach
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Emir SARI 2025-12-21 09:34:11 UTC
I’ve noticed there are quite a few spin boxes in Labplot that adds a suffix to the value with the setSuffix modifier. However, Qt spin boxes are quite limited in terms of proper i18n support, there is no way to use plural forms easily and you can either add a prefix or a suffix, which makes it hard to localise percent values (at least for my language).

The solution would be to use KLocalization::setupSpinBoxFormatString, which allows to use a format like “%v”, which allows translators to see the context easily and modify the strings.

For an example use: https://invent.kde.org/graphics/okular/-/commit/18c62b11d81a70da992e29895b44f79d52946738