From b44cf4ac279c42f8a8499d85ebf0f0986b1ea73c Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sat, 28 Sep 2013 21:28:17 +0000 Subject: [PATCH] Minor improvement in message about last modification time upon opening a file. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23200 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/gnc-main-window.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index 3e98c36b63..4b3b87d111 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -1564,17 +1564,27 @@ static gchar *generate_statusbar_lastmodified_message() // File mtime could be accessed ok gint64 mtime = statbuf.st_mtime; GDateTime *gdt = gnc_g_date_time_new_from_unix_local (mtime); + gchar *dummy_strftime_has_ampm = g_date_time_format (gdt, "%P"); /* Translators: This is the date and time that is shown in - the status bar after opening a file, the date and time of - last modification. */ - gchar *time_string = g_date_time_format (gdt, _("%a %b %e %Y %H:%M:%S")); + the status bar after opening a file: The date and time of + last modification. The string is the format string for + glib's function g_date_time_format(), see there for an + explanation of the modifiers. First string is for a locale + that has the a.m. or p.m. string in its locale, second + string is for locales that do not have that string. */ + gchar *time_string = + g_date_time_format (gdt, (strlen(dummy_strftime_has_ampm) > 0) + ? _("Last modified on %a, %b %e, %Y at %I:%M%P") + : _("Last modified on %a, %b %e, %Y at %H:%M")); + g_date_time_unref (gdt); //g_warning("got time %ld, str=%s\n", mtime, time_string); /* Translators: This message appears in the status bar after opening the file. */ - message = g_strdup_printf(_("File %s opened. Last modified: %s"), + message = g_strdup_printf(_("File %s opened. %s"), filename, time_string); g_free(time_string); + g_free(dummy_strftime_has_ampm); } else {