r23200 - gnucash/trunk/src/gnome-utils - Minor improvement in message about last modification time upon opening a file.
Christian Stimming
cstim at code.gnucash.org
Sat Sep 28 17:28:18 EDT 2013
Author: cstim
Date: 2013-09-28 17:28:17 -0400 (Sat, 28 Sep 2013)
New Revision: 23200
Trac: http://svn.gnucash.org/trac/changeset/23200
Modified:
gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
Minor improvement in message about last modification time upon opening a file.
Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c 2013-09-28 21:28:05 UTC (rev 23199)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c 2013-09-28 21:28:17 UTC (rev 23200)
@@ -1564,17 +1564,27 @@
// 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
{
More information about the gnucash-changes
mailing list