GNOME Bugzilla – Bug 687063
Translated month names should be drawn from locale
Last modified: 2017-06-30 09:33:24 UTC
Currently, localization for the names of months must be done in the PO files for the application. However, locales contain full month names and so these should be drawn from the locale, preventing unnecessary work and potential errors or sync problems caused by having duplicated strings.
See glib/gdatetime.c for how to pull these strings out of the locale data: static const gint weekday_item[2][7] = { { ABDAY_2, ABDAY_3, ABDAY_4, ABDAY_5, ABDAY_6, ABDAY_7, ABDAY_1 }, { DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7, DAY_1 } }; static const gint month_item[2][12] = { { ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 }, { MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7, MON_8, MON_9, MON_10, MON_11, MON_12 }, }; #define WEEKDAY_ABBR(d) nl_langinfo (weekday_item[0][g_date_time_get_day_of_week (d) - 1]) #define WEEKDAY_FULL(d) nl_langinfo (weekday_item[1][g_date_time_get_day_of_week (d) - 1]) #define MONTH_ABBR(d) nl_langinfo (month_item[0][g_date_time_get_month (d) - 1]) #define MONTH_FULL(d) nl_langinfo (month_item[1][g_date_time_get_month (d) - 1])
Fixed on master as of commit 0039e103078a0289f2513f8894bbfe53bc1574e4