[mutter: 3/209] incredibly baroque system to make sure the translators don't have to



commit 45cbaa2d1370e18dd404daa1841e60ccb6f9be29
Author: Thomas James Alexander Thurman <tthurman src gnome org>
Date:   Thu Feb 5 20:02:59 2009 +0000

    incredibly baroque system to make sure the translators don't have to
    
    	* src/core/main.c: incredibly baroque system to make sure
            the translators don't have to update the year number every year.
    
    
    svn path=/trunk/; revision=4118

 ChangeLog       |    5 +++++
 src/core/main.c |   17 +++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 39c8b0e..2352968 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-02-05  Thomas Thurman  <tthurman gnome org>
 
+	* src/core/main.c: incredibly baroque system to make sure
+        the translators don't have to update the year number every year.
+
+2009-02-05  Thomas Thurman  <tthurman gnome org>
+
         * src/ui/theme-parser.c: collapse several strings into one
         for the translators' benefit.
 
diff --git a/src/core/main.c b/src/core/main.c
index 19c2dd3..cfc5929 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -54,6 +54,7 @@
 #include "prefs.h"
 
 #include <glib-object.h>
+#include <glib/gprintf.h>
 
 #include <stdlib.h>
 #include <sys/types.h>
@@ -113,11 +114,23 @@ log_handler (const gchar   *log_domain,
 static void
 version (void)
 {
+  const int latest_year = 2009;
+  char yearbuffer[256];
+  GDate date;
+
+  /* this is all so the string to translate stays constant.
+   * see how much we love the translators.
+   */
+  g_date_set_dmy (&date, 1, G_DATE_JANUARY, latest_year);
+  if (g_date_strftime (yearbuffer, sizeof (yearbuffer), "%Y", &date)==0)
+    /* didn't work?  fall back to decimal representation */
+    g_sprintf (yearbuffer, "%d", latest_year);
+
   g_print (_("metacity %s\n"
-             "Copyright (C) 2001-2008 Havoc Pennington, Red Hat, Inc., and others\n"
+             "Copyright (C) 2001-%s Havoc Pennington, Red Hat, Inc., and others\n"
              "This is free software; see the source for copying conditions.\n"
              "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"),
-           VERSION);
+           VERSION, yearbuffer);
   exit (0);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]