From 06bf58d5faaf40c4daa9b9070d93b4ab9be950bd Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 9 Jul 2024 17:35:48 -0300 Subject: [PATCH] event-widget: Don't modify translated strings --- src/gui/gcal-event-widget.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/gcal-event-widget.c b/src/gui/gcal-event-widget.c index 3870c507..09a5ff24 100644 --- a/src/gui/gcal-event-widget.c +++ b/src/gui/gcal-event-widget.c @@ -370,14 +370,16 @@ gcal_event_widget_set_event_tooltip (GcalEventWidget *self, } else { - /* Translators: %s is a URL informed as the location of the event */ - g_string_append_printf (string, _("\n\nAt %s"), location); + g_autoptr (GString) truncated_location = g_string_new (location); - if (g_utf8_strlen (location, -1) > LOCATION_MAX_LEN) + if (truncated_location->len > LOCATION_MAX_LEN) { - g_string_truncate (string, string->len - 1); + g_string_truncate (string, LOCATION_MAX_LEN - 1); g_string_append (string, "…"); } + + /* Translators: %s is a URL informed as the location of the event */ + g_string_append_printf (string, _("\n\nAt %s"), truncated_location->str); } } else