Format: use fmt::format correctly with runtime format strings

Starting with C++20, `fmt::format` will process the format string at
compile time by default. We need to opt out in the cases where this is
not possible by using `fmt::runtime(...)`, like, for example, when using
our various translation utilities.

This mirrors prior commit e62aa986b2 and
fixes 2 cases that have slipped back in.

Pull Request: https://projects.blender.org/blender/blender/pulls/138640
This commit is contained in:
Jesse Yurkovich
2025-05-09 06:43:48 +02:00
committed by Jesse Yurkovich
parent efefb16d4b
commit eb82c4edf1

View File

@@ -447,8 +447,8 @@ static void panel_draw(const bContext *C, Panel *panel)
uiLayout *split = &adaptive_panel.body->split(0.4f, false);
split->column(true).label("", ICON_NONE);
uiLayout *col = &split->column(true);
col->label(fmt::format(RPT_("Viewport {:.2f} px"), preview), ICON_NONE);
col->label(fmt::format(RPT_("Render {:.2f} px"), render), ICON_NONE);
col->label(fmt::format(fmt::runtime(RPT_("Viewport {:.2f} px")), preview), ICON_NONE);
col->label(fmt::format(fmt::runtime(RPT_("Render {:.2f} px")), render), ICON_NONE);
}
}