Merge lp:~gunnarhj/ubuntu/raring/evolution-data-server/days-months into lp:ubuntu/raring/evolution-data-server

Proposed by Gunnar Hjalmarsson
Status: Work in progress
Proposed branch: lp:~gunnarhj/ubuntu/raring/evolution-data-server/days-months
Merge into: lp:ubuntu/raring/evolution-data-server
Diff against target: 136 lines (+118/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/01_days_months_in_current_language.patch (+109/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~gunnarhj/ubuntu/raring/evolution-data-server/days-months
Reviewer Review Type Date Requested Status
Jamie Strandboge Needs Information
Mathieu Trudel-Lapierre Pending
Ubuntu branches Pending
Review via email: mp+159975@code.launchpad.net

Commit message

debian/patches/01_days_months_in_current_language.patch:
Display names of weekdays and months in the current language
(LP: #1160441).

To post a comment you must log in.
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

The patch states "Forwarded: no". Does this not affect upstream?

review: Needs Information
Revision history for this message
Iain Lane (laney) wrote :

Any news on that question?

Unmerged revisions

186. By Gunnar Hjalmarsson

debian/patches/01_days_months_in_current_language.patch:
Display names of weekdays and months in the current language
(LP: #1160441).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-03-21 11:01:22 +0000
3+++ debian/changelog 2013-04-21 12:10:34 +0000
4@@ -1,3 +1,11 @@
5+evolution-data-server (3.6.4-0ubuntu2) UNRELEASED; urgency=low
6+
7+ * debian/patches/01_days_months_in_current_language.patch:
8+ Display names of weekdays and months in the current language
9+ (LP: #1160441).
10+
11+ -- Gunnar Hjalmarsson <gunnarhj@ubuntu.com> Sun, 21 Apr 2013 13:09:00 +0200
12+
13 evolution-data-server (3.6.4-0ubuntu1) raring; urgency=low
14
15 * New upstream release.
16
17=== added directory 'debian/patches'
18=== added file 'debian/patches/01_days_months_in_current_language.patch'
19--- debian/patches/01_days_months_in_current_language.patch 1970-01-01 00:00:00 +0000
20+++ debian/patches/01_days_months_in_current_language.patch 2013-04-21 12:10:34 +0000
21@@ -0,0 +1,109 @@
22+Description: Display names of weekdays and months in the current language
23+Bug: https://launchpad.net/bugs/1160441
24+Forwarded: no
25+Author: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
26+
27+--- evolution-data-server-3.6.4.orig/libedataserver/e-data-server-util.c 2012-11-13 10:12:28 +0000
28++++ evolution-data-server-3.6.4/libedataserver/e-data-server-util.c 2013-04-21 03:42:42 +0200
29+@@ -21,6 +21,7 @@
30+
31+ #include "config.h"
32+
33++#include <locale.h>
34+ #include <string.h>
35+ #include <sys/stat.h>
36+ #include <time.h>
37+@@ -584,6 +585,75 @@
38+ }
39+
40+ /**
41++ * Helper for e_strftime()
42++ *
43++ * Translate names of days and months using the current language by
44++ * splitting a format specification and applying a suitable locale
45++ * when converting respective token.
46++ **/
47++static gsize
48++strftime_days_months (gchar *string,
49++ gsize max,
50++ const gchar *fmt,
51++ const struct tm *tm)
52++{
53++ gchar *tmp = NULL;
54++ gint i, j;
55++ gchar formatted_token[100];
56++
57++ gchar **tokens = g_strsplit (fmt, " ", 0);
58++
59++ /* Conversion specifications for names of days and months */
60++ const gchar *dm_names[] = { "%a", "%A", "%b", "%B", "%h", NULL };
61++
62++ /* Get some locale info */
63++ const gchar *time_locale = setlocale (LC_TIME, NULL);
64++ const gchar *message_locale = setlocale (LC_MESSAGES, NULL);
65++
66++ for (i = 0; tokens[i] != NULL; i++)
67++ {
68++ gboolean is_day_month = FALSE;
69++
70++ for (j = 0; dm_names[j] != NULL; j++) {
71++ if (g_strrstr (tokens[i], dm_names[j]) != NULL) {
72++ is_day_month = TRUE;
73++ break;
74++ }
75++ }
76++
77++ if (is_day_month)
78++ setlocale (LC_TIME, message_locale);
79++ else
80++ setlocale (LC_TIME, time_locale);
81++
82++ if (strlen (tokens[i]) == 0)
83++ formatted_token[0] = '\0';
84++ else {
85++ if (!strftime (formatted_token, max, tokens[i], tm)) {
86++ g_free (tmp);
87++ break;
88++ }
89++ }
90++
91++ if (i == 0)
92++ tmp = g_strdup (formatted_token);
93++ else
94++ tmp = g_strjoin (" ", tmp, formatted_token, NULL);
95++ }
96++
97++ /* Reset the locale */
98++ setlocale (LC_TIME, time_locale);
99++
100++ g_strfreev (tokens);
101++ if (!tmp)
102++ return 0;
103++
104++ strcpy (string, tmp);
105++ g_free (tmp);
106++ return strlen (string);
107++}
108++
109++/**
110+ * e_strftime:
111+ * @string: The string array to store the result in.
112+ * @max: The size of array @s.
113+@@ -612,7 +682,7 @@
114+ g_return_val_if_fail (tm != NULL, 0);
115+
116+ #ifdef HAVE_LKSTRFTIME
117+- ret = strftime (string, max, fmt, tm);
118++ ret = strftime_days_months (string, max, fmt, tm);
119+ #else
120+ ffmt = g_strdup (fmt);
121+ ff = ffmt;
122+@@ -636,7 +706,7 @@
123+ }
124+ #endif
125+
126+- ret = strftime (string, max, ffmt, tm);
127++ ret = strftime_days_months (string, max, ffmt, tm);
128+ g_free (ffmt);
129+ #endif
130+
131
132=== added file 'debian/patches/series'
133--- debian/patches/series 1970-01-01 00:00:00 +0000
134+++ debian/patches/series 2013-04-21 12:10:34 +0000
135@@ -0,0 +1,1 @@
136+01_days_months_in_current_language.patch

Subscribers

People subscribed via source and target branches