Bug 513640 - Improve i18n for spin boxes
Summary: Improve i18n for spin boxes
Status: REPORTED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Stefan Gerlach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-21 09:34 UTC by Emir SARI
Modified: 2025-12-22 11:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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