Werk #20133 · Jul 3, 26
Named parameters for localized formspec labels
Localizable strings created via Title, Label, Help and Message
(from cmk.rulesets.v1) can now be formatted with named parameters
instead of only positional ones.
Previously only positional formatting was possible:
Title("Replaced %s by %s") % (old, new)
Now you can pass a mapping and reference the parameters by name:
Title("Replaced %(old)s by %(new)s") % {"old": old, "new": new}
Named parameters give translators more context and let them reorder the parameters for languages with a different word order. Positional formatting continues to work, so no changes to existing plugins are required.
Details
- Class:
- New Features
- Level:
- Trivial
- Component:
- Checks
- Versions:
- 3.0.0b1Not yet releasedAll Editions