[gnome-clocks/wip/vala] localize weekday abbreviations



commit 5293863fed52297103b2a7b6e617c26649f31881
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Feb 17 22:28:32 2013 +0100

    localize weekday abbreviations

 src/utils.vala |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/src/utils.vala b/src/utils.vala
index a588cc0..8e98663 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -137,6 +137,10 @@ public class Weekdays {
         SUN
     }
 
+    private const bool[] weekdays = {
+        true, true, true, true, true, false, false
+    };
+
     private const string[] plurals = {
         N_("Mondays"),
         N_("Tuesdays"),
@@ -147,19 +151,14 @@ public class Weekdays {
         N_("Sundays")
     };
 
-    private const string[] abbreviations = {
-        // TODO: fetch localized abbreviations from glib/libc
-        "Mon",
-        "Tue",
-        "Wed",
-        "Thu",
-        "Fri",
-        "Sat",
-        "Sun"
-    };
-
-    private const bool[] weekdays = {
-        true, true, true, true, true, false, false
+    private static string[] abbreviations = {
+         (new GLib.DateTime.utc (1, 1, 1, 0, 0, 0)).format ("%a"),
+         (new GLib.DateTime.utc (1, 1, 2, 0, 0, 0)).format ("%a"),
+         (new GLib.DateTime.utc (1, 1, 3, 0, 0, 0)).format ("%a"),
+         (new GLib.DateTime.utc (1, 1, 4, 0, 0, 0)).format ("%a"),
+         (new GLib.DateTime.utc (1, 1, 5, 0, 0, 0)).format ("%a"),
+         (new GLib.DateTime.utc (1, 1, 6, 0, 0, 0)).format ("%a"),
+         (new GLib.DateTime.utc (1, 1, 7, 0, 0, 0)).format ("%a"),
     };
 
     public static Day get_first_weekday () {


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