From b900a65760d330060d26460b873cc3e5f3d5d0ee Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 24 Feb 2026 01:09:29 +0200 Subject: [PATCH] Use standalone Month format when appropriate Some locales use different strings for the months depending if they are accompanied by a numberic date or not. When we use the month name as a standalone, we should use %OB instead to accomodate for these locales. For more see: https://docs.gtk.org/glib/method.DateTime.format.html Close #1546 Part-of: --- src/gui/gcal-calendar-navigation-button.c | 4 ++-- src/gui/views/gcal-month-cell.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/gcal-calendar-navigation-button.c b/src/gui/gcal-calendar-navigation-button.c index a5317a62..7d37353a 100644 --- a/src/gui/gcal-calendar-navigation-button.c +++ b/src/gui/gcal-calendar-navigation-button.c @@ -99,11 +99,11 @@ gcal_calendar_navigation_button_set_property (GObject *object, gcal_clear_date_time (&self->active_date); self->active_date = g_date_time_ref (g_value_get_boxed (value)); /* - * Translators: %B is the month name and %Y is the year. + * Translators: %OB is the month name and %Y is the year. * More formats can be found on the doc: * https://docs.gtk.org/glib/method.DateTime.format.html */ - gtk_menu_button_set_label (self->button, g_date_time_format (self->active_date, _ ("%B %Y"))); + gtk_menu_button_set_label (self->button, g_date_time_format (self->active_date, _ ("%OB %Y"))); break; case PROP_ACTIVE: diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c index 0771740c..639212e4 100644 --- a/src/gui/views/gcal-month-cell.c +++ b/src/gui/views/gcal-month-cell.c @@ -231,7 +231,7 @@ update_weather (GcalMonthCell *self) /* No risk of conflicting with the weather forecast labels in their absence, use the full month name label */ if (day_of_month == 1) { - g_autofree gchar *month_name = g_date_time_format (self->date, "%B"); + g_autofree gchar *month_name = g_date_time_format (self->date, "%OB"); gtk_label_set_text (self->day_label, month_name); } } @@ -519,7 +519,7 @@ gcal_month_cell_set_date (GcalMonthCell *self, if (day_of_month == 1) { - g_autofree gchar *month_name = g_date_time_format (date, "%B"); + g_autofree gchar *month_name = g_date_time_format (date, "%OB"); gtk_label_set_text (self->day_label, month_name); gtk_widget_add_css_class (GTK_WIDGET (self->day_label), "first-day"); }