aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorChyla Zbigniew <chyla@src.gnome.org>2001-09-11 07:15:31 +0800
committerChyla Zbigniew <chyla@src.gnome.org>2001-09-11 07:15:31 +0800
commit0f464193fe82b5dea993048d7d91881baa828780 (patch)
tree83f0269c648806b353052254a0d550af3357d49e /calendar
parente0beab13257c680c2772e842c82cf328f2ce4422 (diff)
downloadgsoc2013-evolution-0f464193fe82b5dea993048d7d91881baa828780.tar.gz
gsoc2013-evolution-0f464193fe82b5dea993048d7d91881baa828780.tar.zst
gsoc2013-evolution-0f464193fe82b5dea993048d7d91881baa828780.zip
Convert string generated by strftime to UTF-8.
* gui/print.c (format_date): Convert string generated by strftime to UTF-8. (print_week_view_background): Ditto. (print_month_summary): Ditto. (print_month_small): Use U_() instead of _(). (print_day_background): Ditto. (print_todo_details): Ditto. (print_date_label): Convert generated string to UTF-8. svn path=/trunk/; revision=12751
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog11
-rw-r--r--calendar/gui/print.c32
2 files changed, 34 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 2db3ecb34d..afa3907a89 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,14 @@
+2001-09-10 Zbigniew Chyla <cyba@gnome.pl>
+
+ * gui/print.c
+ (format_date): Convert string generated by strftime to UTF-8.
+ (print_week_view_background): Ditto.
+ (print_month_summary): Ditto.
+ (print_month_small): Use U_() instead of _().
+ (print_day_background): Ditto.
+ (print_todo_details): Ditto.
+ (print_date_label): Convert generated string to UTF-8.
+
2001-09-10 Federico Mena Quintero <federico@ximian.com>
* cal-util/cal-component.c (cal_component_alarm_get_attach):
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index e1bae904ff..3a3ba64b22 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -43,6 +43,7 @@
#include <libgnomeprint/gnome-printer-dialog.h>
#include <e-util/e-dialog-widgets.h>
#include <e-util/e-time-utils.h>
+#include <e-util/e-unicode-i18n.h>
#include <gal/widgets/e-unicode.h>
#include <cal-util/timeutil.h>
#include "calendar-commands.h"
@@ -437,6 +438,7 @@ format_date(time_t time, int flags, char *buffer, int bufflen)
icaltimezone *zone = get_timezone ();
char fmt[64];
struct tm tm;
+ char *utf_str;
tm = *convert_timet_to_struct_tm (time, zone);
@@ -462,6 +464,10 @@ format_date(time_t time, int flags, char *buffer, int bufflen)
strcat(fmt, "%Y");
}
strftime(buffer, bufflen, fmt, &tm);
+ utf_str = e_utf8_from_locale_string (buffer);
+ strncpy (buffer, utf_str, bufflen - 1);
+ buffer[bufflen - 1] = '\0';
+ g_free (utf_str);
return buffer;
}
@@ -546,7 +552,7 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, time_t month,
week_start_day = calendar_config_get_week_start_day ();
weekday = week_start_day;
for (x = 0; x < 7; x++) {
- print_text (pc, font_bold, _(daynames[weekday]), ALIGN_CENTER,
+ print_text (pc, font_bold, U_(daynames[weekday]), ALIGN_CENTER,
left + x * col_width, left + (x + 1) * col_width,
top, top - row_height * 1.4);
weekday = (weekday + 1) % 7;
@@ -756,9 +762,9 @@ print_day_background (GnomePrintContext *pc, GnomeCalendar *gcal,
minute = "00";
} else {
if (i < 12)
- minute = _("am");
+ minute = U_("am");
else
- minute = _("pm");
+ minute = U_("pm");
hour = i % 12;
if (hour == 0)
@@ -1406,7 +1412,7 @@ print_week_view_background (GnomePrintContext *pc, GnomeFont *font,
int day, day_x, day_y, day_h;
double x1, x2, y1, y2, font_size, fillcolor;
struct tm tm;
- char *format_string, buffer[128];
+ char *format_string, buffer[128], *utf_str;
font_size = gnome_font_get_size (font);
@@ -1454,8 +1460,10 @@ print_week_view_background (GnomePrintContext *pc, GnomeFont *font,
}
strftime (buffer, sizeof (buffer), format_string, &tm);
- print_text (pc, font, buffer, ALIGN_RIGHT,
+ utf_str = e_utf8_from_locale_string (buffer);
+ print_text (pc, font, utf_str, ALIGN_RIGHT,
x1, x2 - 4, y1 - 2, y1 - 2 - font_size);
+ g_free (utf_str);
}
}
@@ -1656,6 +1664,8 @@ print_month_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
y2 = top - font_size * 1.5;
for (col = 0; col < columns; col++) {
+ char *utf_str;
+
if (tm.tm_wday == 6 && compress_weekend) {
strftime (buffer, sizeof (buffer), "%a/", &tm);
len = strlen (buffer);
@@ -1671,7 +1681,9 @@ print_month_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
x2 = x1 + cell_width;
print_border (pc, x1, x2, y1, y2, 1.0, -1.0);
- print_text (pc, font, buffer, ALIGN_CENTER, x1, x2, y1, y2);
+ utf_str = e_utf8_from_locale_string (buffer);
+ print_text (pc, font, utf_str, ALIGN_CENTER, x1, x2, y1, y2);
+ g_free (utf_str);
tm.tm_mday++;
tm.tm_wday = (tm.tm_wday + 1) % 7;
@@ -1704,7 +1716,7 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal,
gnome_print_setrgbcolor (pc, 0, 0, 0);
gnome_print_setlinewidth (pc, 0.0);
- titled_box (pc, _("Tasks"), font_summary, ALIGN_CENTER | ALIGN_BORDER,
+ titled_box (pc, U_("Tasks"), font_summary, ALIGN_CENTER | ALIGN_BORDER,
&left, &right, &top, &bottom, 1.0);
y = top - 3;
@@ -2084,7 +2096,7 @@ print_date_label (GnomePrintContext *pc, CalComponent *comp,
icaltimezone *zone = get_timezone ();
CalComponentDateTime datetime;
time_t start = 0, end = 0, complete = 0, due = 0;
- static char buffer[1024];
+ static char buffer[1024], *utf_text;
cal_component_get_dtstart (comp, &datetime);
if (datetime.value)
@@ -2129,8 +2141,10 @@ print_date_label (GnomePrintContext *pc, CalComponent *comp,
write_label_piece (due, buffer, 1024, _("Due "), NULL);
}
- print_text_size (pc, 12, buffer, ALIGN_LEFT,
+ utf_text = e_utf8_from_locale_string (buffer);
+ print_text_size (pc, 12, utf_text, ALIGN_LEFT,
left, right, top, top - 15);
+ g_free (utf_text);
}
static void
b2d84dd'>Upgrade to 1.54.1.thierry2004-07-072-3/+3 * Add dinotrace, a mature signal waveform viewer used to debug digital designpav2004-07-064-0/+37 * Update to 0.7.20040606.nobutaka2004-07-042-4/+4 * Update to version 0.34krion2004-07-034-199/+147 * Update to version 0.16krion2004-06-283-12/+11 * - Fix WWW:krion2004-06-151-1/+1 * Upgrade to 1.53.1.thierry2004-06-143-5/+14 * o Update to 6.0.8lioux2004-06-133-8/+16 * - Fix MASTER_SITESkrion2004-06-081-3/+1 * - Tie subdirs to respective master sitespav2004-06-021-3/+4 * - Update WWWpav2004-05-301-1/+1 * Update to 0.2.6 (unbreak on 4.x)vs2004-05-253-11/+13 * update to version 2.0.3.3-1mr2004-05-232-5/+5 * BROKEN on 4.x: Does not compilekris2004-05-231-1/+7 * Upgrade to 1.1.1.thierry2004-05-237-48/+125 * - Fix dependencies of package: no point having meta port with BUILD_DEPENDSpav2004-05-221-1/+2 * - Add MASTER_SITE_LOCAL to MASTER_SITES to improve availability.hrs2004-05-181-1/+4 * Add cad/alliance, which is a complete set of free CAD tools andhrs2004-05-1411-0/+1522 * Make portlint happy by replacing space to tabmaho2004-05-071-2/+2 * Add netgen 4.3.1, an automatic 3D tetrahedral mesh generator.thierry2004-05-0611-0/+291 * Unbreak.maho2004-05-062-2/+22 * unzip is only used in the install phase, so it's a BUILD_DEPENDS, not ankris2004-05-031-1/+1 * Unbreak if Mesa/libglut not present.vs2004-04-191-0/+6 * BROKEN: Does not compilekris2004-04-171-0/+2 * Update to 0.1.4:vs2004-04-155-26/+22 * unzip is an EXTRACT_DEPENDS, not BUILD_DEPENDSkris2004-04-121-1/+1 * Tidy up whitespace.trevor2004-04-112-2/+2 * Trim whitespace.trevor2004-04-111-1/+1 * Chase the glib20 update, and bump all affected ports' PORTREVISIONs.marcus2004-04-053-2/+3 * - Update to version 3.1.38krion2004-04-034-99/+76 * Remove category pkg/COMMENT files in favour of a COMMENT variable in thekris2004-04-022-1/+2 * SIZEify (maintainer timeout)trevor2004-03-319-0/+10 * Style:pav2004-03-294-66/+32 * correct pkg-plist creation.mr2004-03-291-4/+4 * add qcad-partslib the parts-library for qcad.mr2004-03-284-0/+47 * - upgrade to 2.0.3.1mr2004-03-285-212/+36 * - Reset maintainer to ports@FreeBSD.org, thank you Anders forkrion2004-03-251-1/+1 * Upgrade to 1.51.4.thierry2004-03-212-3/+3 * Reorder those filesmat2004-03-211-1/+1 * - Update to version 20040220krion2004-03-192-4/+4 * Add size data, approved by maintainers.trevor2004-03-192-0/+2 * Add size data.trevor2004-03-181-0/+1 * SIZEify.trevor2004-03-181-0/+1 * - Update to version 0.42bkrion2004-03-1721-5/+237 * - Update to version 4.6.0krion2004-03-153-185/+366 * Whoa there, boy, that's a mighty big commit y'all have there...ade2004-03-149-9/+9 * now we have python shared lib by defaultijliao2004-03-091-7/+3 * - Update gEDA suite to 20040111 versionpav2004-03-0725-156/+371 * - This is not using libgeda at all, so don't depend on itpav2004-03-071-4/+2 * Unbreak by chasing checksum (minor source code changes, and a new datakris2004-03-062-3/+3 * Remove qmake from RUN_DEPENDS in x11-toolkits/qt32 and chase ports whichlofi2004-02-271-0/+2 * Remove qmake from RUN_DEPENDS in x11-toolkits/qt32 and chase ports whichlofi2004-02-271-1/+2 * fix dependenceijliao2004-02-241-11/+6 * - Remove unneeded dependency on teTeX, add gm4 and tk as run dependency toopav2004-02-241-1/+2 * BROKEN: Broken dependencieskris2004-02-231-0/+2 * BROKEN: Checksum mismatchkris2004-02-221-0/+2 * add fandango 0.2.5ijliao2004-02-205-0/+125 * - Update to 20040215pav2004-02-203-17/+34 * try to fix pkg-plistmr2004-02-182-25/+33 * BROKEN on 5.x: broken pkg-plistkris2004-02-181-0/+4 * add patch to compile qg_commandwidget.cpp under -stablemr2004-02-121-7/+5 * - Upgrade to QCad version 2.0.2.0-1mr2004-02-103-7/+15 * Fix fetch.arved2004-02-101-1/+1 * USE_SIZEifylioux2004-02-082-0/+2 * This port is also broken on 4.x, and will be removed after April 7kris2004-02-081-5/+2 * BROKEN on 5.x: fails to configurekris2004-02-081-1/+7 * - Fix build on bentokrion2004-02-071-3/+3 * Use PLIST_FILES (bento-tested, marcus-reviewed).trevor2004-02-062-1/+1 * Use PLIST_FILES.trevor2004-02-064-2/+2 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-0427-5/+27 * Drop maintainership to ports@maho2004-02-031-1/+1 * Add conflictsarved2004-02-021-1/+1 * magic.h wasn't able to determine LITTLE_ENDIAN xor BIG_ENDIAN for amd64.oliver2004-01-311-7/+20 * - Fix plist and bump PORTREVISIONkrion2004-01-312-1/+3 * Unbreak on 4.x.linimon2004-01-302-7/+26 * - Add dependency on tcl to satisfy configure scriptpav2004-01-291-0/+1 * SIZEify.trevor2004-01-298-0/+14 * Add SIZE.trevor2004-01-2813-0/+23 * - Update to version 3.2.0krion2004-01-275-82/+102 * fix buildoliver2004-01-251-1/+1 * No member of the kde@ team has touched anything related to Qt2 in ages, sowill2004-01-241-1/+1 * fix patchfileoliver2004-01-241-2/+2 * Use the CPIO macro defined in bsd.port.mk.trevor2004-01-221-2/+2 * - Update to 20030815 snapshotpav2004-01-227-130/+164 * Use the new ghostscript options.marcus2004-01-211-8/+2 * Mark as broken on 5.x due to the usual gcc problems (string continuation).linimon2003-12-191-1/+7 * Update to 20031202 snapshot. Summary of changes listed onlinimon2003-12-183-8/+20 * - Update to 1.50.0pav2003-12-153-6/+7 * Fix build on both, 4 and 5oliver2003-12-114-3/+57 * - www.code-aster.org was reorganized. fix fetchingpav2003-12-112-4/+4 * USE_MESA -> USE_GLfjoe2003-12-101-1/+1 * . Remove metis-edf after a repo copy to the math category.glewis2003-12-109-158/+0 * fix build on CURRENToliver2003-12-104-8/+75 * fix build on CURRENToliver2003-12-105-4/+200 * update chipmunk to 5.62 which unbreaks the CURRENT buildoliver2003-12-109-65/+107 * unbreak build on CURRENToliver2003-12-1012-4/+622 * Work around internal compiler error on -current.tg2003-12-081-0/+11 * - Upgrading french/aster from 7.1 to 7.2;oliver2003-12-088-31/+80 * update qcad to version 2.0.1.3-1mr2003-12-052-2/+2 * Fix build/work of qcad:mr2003-12-047-216/+5 * Make BROKEN message more specific.linimon2003-11-231-1/+1 * - Don't link with randlinepav2003-11-229-539/+16 * - Fix installpav2003-11-201-2/+4 * Mark as broken while we muddle through the compile problem withlinimon2003-11-201-0/+2 * - Update to 2.0.0pre4sergei2003-11-163-35/+41 * Use the FIND and XARGS macros introduced in bsd.port.mk 1.391.trevor2003-11-132-2/+2 * add pythoncad release 10ijliao2003-11-125-0/+244 * . Remove kaskade port after repo copy to math category.glewis2003-11-0813-1508/+0 * . Remove felt port now its been repo copied to the science category.glewis2003-11-0811-990/+0 * Mark BROKEN (see bento logs). These ports are scheduled for removalkris2003-11-031-4/+2 * Update to QCad 2.0.1.1mr2003-10-3110-2736/+282 * Move inclusion of bsd.port.pre.mk past definition of variables.linimon2003-10-293-13/+12 * Maintainer Update to latest snapshot. Changes: add AMD64 supportlinimon2003-10-273-5/+4 * - Update to version 0.15krion2003-10-262-3/+3 * Mark as broken on 5.x. Distfile dates from 1994, last patch dates fromlinimon2003-10-251-1/+7 * Mark as broken on 5.x. The distfile dates from 1994 so it looks unlikelylinimon2003-10-251-1/+7 * Cosmetic fix: use %%DOCSDIR%% macro.osa2003-10-226-169/+169 * Maintainer update to snapshot version. In addition to fixing the portlinimon2003-10-172-4/+6 * Before committing the previous BROKEN changes I carefully checked the statuskris2003-10-161-7/+1 * BROKEN on 5.x: does not compilekris2003-10-164-4/+28 * Update to 20030804, unbreak, and fix plist.linimon2003-10-154-7/+11 * update cad/linux-eagle: 4.09r2 -> 4.11daichi2003-10-146-24/+78 * - Chase libraries to actual math/gsl version.krion2003-10-131-1/+1 * NEW port CAD/admeshedwin2003-10-105-0/+53 * Fix checksums.edwin2003-10-041-1/+1 * ECHO -> ECHO_MSGedwin2003-09-272-3/+3 * Update port: cad/xcircuitedwin2003-09-271-13/+13 * The CalculiX authors ahve fixed a segmentation faultnork2003-09-253-1/+29 * Make portlint(1) happy by changing strip to ${STRIP_CMD}osa2003-09-242-2/+2 * Update to 1.46.0erwin2003-09-102-2/+2 * - Tarball was rerolled by author, it contains onlykrion2003-09-051-1/+1 * cad/astk-serveur & cad/astk-client: fixing patch + tarball has been rerolled.edwin2003-09-024-3/+3 * [PATCH] cad/xcircuit: enable choose of ghostscript interpreteredwin2003-08-311-2/+28 * Unbreak for 4-STABLE with ad hoc patch.maho2003-08-301-0/+127 * cad/astk-client: chasing tk83 -> tk84 + defining more tools.edwin2003-08-293-1/+24 * - Update to version 0.14krion2003-08-272-2/+2 * update cat/gmsh: fix small typodaichi2003-08-251-1/+1 * Update to CAD/feltedwin2003-08-255-9/+741 * Bump PORTREVISION after lang/python's changing default toperky2003-08-231-0/+1 * update cad/gmsh: add USE_TRIANGLE knobdaichi2003-08-222-2/+20 * update cad/gmsh: 1.45.1 -> 1.45.2daichi2003-08-212-2/+2 * update cad/xcircuit: 3.1.15 -> 3.1.18daichi2003-08-203-13/+11 * - Update to version 0.14krion2003-08-182-3/+7 * Switch to tcl/tk 8.4 and bump PORTREVISION.kris2003-08-171-3/+3 * unbreaking on Alpha (and maybe on other 64bit platforms (untested))oliver2003-08-134-14/+49 * Rename the name of the patch. just a typomaho2003-08-091-0/+0 * fix a problem when deleting exampledirmaho2003-08-091-7/+7 * update to 1.1maho2003-08-0920-245/+275 * As announced on May 6, remove the broken sis port.kris2003-08-0835-1233/+0 * As announced on May 6, remove the broken pisces port.kris2003-08-0823-1102/+0 * replace PERL -pi by REINPLACE_CMDoliver2003-08-041-4/+5 * Release maintainership of ports due to personal technical difficulties.naddy2003-07-311-1/+1 * fix cad/astk-serveur: fixing RUN_DEPENDSdaichi2003-07-281-4/+9 * Unbreak for 4-STABLE with ad hoc patch.maho2003-07-271-0/+127 * mark both conflicting each other (they are installing both a same named binary)oliver2003-07-251-0/+2 * Update to 1.7.3 and fix unfetchable distfileoliver2003-07-247-67/+78 * Add gmsh 1.45.1, an automatic 3D finite element mesh generator.oliver2003-07-235-0/+102 * Add astk-client , graphical interface for Code_Aster (client side).oliver2003-07-232-0/+18 * Add astk-serveur 1.0.14,oliver2003-07-2310-0/+438 * Add metis-edf 3, meshes partionning tool used by Code_Aster.oliver2003-07-238-0/+121 * Note Patch level 1 and 2 + update the documentation URL.oliver2003-07-221-6/+4 * The tar.Z file disappeared on the ftp. Use the tar.gz file instead.oliver2003-07-222-2/+1 * 1. REAL cleaning on this port. The files dir is now organized so themaho2003-07-1943-976/+808 * Honor CXXFLAGS.maho2003-07-192-5/+5 * Partial fix for builds with gcc 3.3. This still blows up later on.kris2003-07-181-0/+10 * Remove Makefile~; of course it ismaho2003-07-131-78/+0 * Add new port cad/tochnogmaho2003-07-1312-0/+555 * a) patch-cgx_1.0+src+readcxx.c is not needed anymore since wemaho2003-07-124-127/+42 * a. This patch adds the documentation and makesmaho2003-07-084-41/+763 * Add Macquarie University patches:maho2003-07-014-7/+3127 * some cleanupsmaho2003-07-014-29/+853 * Add a conflict for ploticus, slffea and swi-pl.arved2003-06-291-0/+1 * Fix fgets buffer overflowkris2003-06-272-1/+13 * Update to version 3.1.15.naddy2003-06-066-146/+149 * Mark BROKEN on all versions, not just 5.1kris2003-06-051-5/+1 * cad/cider fix unfetchable distfile problemedwin2003-05-232-2/+1 * Correct typo in WWW.sheldonh2003-05-211-1/+1 * NEW port CAD/varkonedwin2003-05-218-0/+750 * Change the Maintainer to someone who uses this port more than I do.keichii2003-05-191-1/+1 * BROKEN on 5.1: does not compilekris2003-05-181-1/+7 * BROKEN on 5.1: bad C++kris2003-05-181-0/+4 * Fix MAN. This commit completes changes submitted in the PR. I madewill2003-05-171-4/+3 * Fix this port and remove BROKEN.will2003-05-172-18/+4 * Chase the libgeda shared lib version.marcus2003-05-131-1/+1 * Fix build by adding USE_GETOPT_LONG.marcus2003-05-131-1/+1 * Support CXXFLAGS properlyijliao2003-05-121-0/+5 * Fix broken for 4-STABLE:maho2003-05-102-5/+131 * The xcircuit site no longer carries bz2 archives of older distfiles.petef2003-05-102-2/+1 * unbreak by upgrading to 0.41ijliao2003-05-077-68/+5 * unbreak by upgrade to 0.33ijliao2003-05-074-230/+228 * BROKEN: Does not compilekris2003-05-073-0/+6 * BROKEN: Does not installkris2003-05-061-0/+2 * BROKEN: Does not buildkris2003-05-061-0/+2 * Update to version 20030223 which now works with guile 1.6.marcus2003-05-0622-59/+200 * A Three-Dimensional Structural Finite Element Programmaho2003-05-058-0/+175 * a. Slight enhancementmaho2003-05-055-227/+199 * Chase guile's shared lib version.marcus2003-05-028-8/+8 * Use a versioned distfilearved2003-05-012-10/+13 * Use USE_GETOPT_LONG.naddy2003-04-281-8/+2 * Update to version 0.13.naddy2003-04-243-8/+6 * Remove USE_GNOMENG.marcus2003-04-1812-12/+0 * Update to 6.0.7.1lioux2003-03-292-3/+4 * cad/leocad checksum update and minor include file fixedwin2003-03-283-3/+11 * Clear moonlight beckons.ade2003-03-0710-5/+5 * Trim pkg-descr and unbreak on 5.0kris2003-03-042-10/+13 * Maintainer-update of cad/linux-eagleedwin2003-02-242-2/+4 * De-pkg-commentlioux2003-02-242-1/+1 * Fix build after QT directory structure change.demon2003-02-232-2/+2 * De-pkg-comment.knu2003-02-2140-20/+20 * De-pkg-comment.knu2003-02-21