After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687063 - Translated month names should be drawn from locale
Translated month names should be drawn from locale
Status: RESOLVED FIXED
Product: gnome-contacts
Classification: Core
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Contacts maintainer(s)
GNOME Contacts maintainer(s)
available
Depends on:
Blocks:
 
 
Reported: 2012-10-28 21:01 UTC by Seán de Búrca
Modified: 2017-06-30 09:33 UTC
See Also:
GNOME target: ---
GNOME version: 3.11/3.12



Description Seán de Búrca 2012-10-28 21:01:00 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.
Comment 1 Matthias Clasen 2012-10-29 00:39:58 UTC
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])
Comment 2 Niels De Graef 2017-06-30 09:33:24 UTC
Fixed on master as of commit 0039e103078a0289f2513f8894bbfe53bc1574e4