From 647558b1405c217f6e278a24660b273ab4c17a57 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Fri, 2 Feb 2024 17:28:22 -0800 Subject: [PATCH] fix plural language in singular scenarios --- src/df/gfx/df_gfx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 1b6a2eb3..7d3b1e9e 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -6793,12 +6793,13 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags if(opt_member != 0) { U64 member_byte_size = tg_byte_size_from_graph_raddbg_key(graph, rdbg, opt_member->type_key); - str8_list_pushf(arena, &list, "member (%I64u offset, %I64u bytes)", opt_member->off, member_byte_size); + str8_list_pushf(arena, &list, "member (%I64u offset, %I64u byte%s)", opt_member->off, member_byte_size, member_byte_size > 1 ? "s" : ""); } else { String8 basic_type_kind_string = tg_kind_basic_string_table[tg_kind_from_key(eval.type_key)]; - str8_list_pushf(arena, &list, "%S (%I64u bytes)", basic_type_kind_string, tg_byte_size_from_graph_raddbg_key(graph, rdbg, eval.type_key)); + U64 byte_size = tg_byte_size_from_graph_raddbg_key(graph, rdbg, eval.type_key); + str8_list_pushf(arena, &list, "%S (%I64u byte%s)", basic_type_kind_string, byte_size, byte_size > 1 ? "s" : ""); } }