aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDjihed Afifi <djihed@src.gnome.org>2008-01-09 06:41:22 +0800
committerDjihed Afifi <djihed@src.gnome.org>2008-01-09 06:41:22 +0800
commit258ae9acd3fbaa82a03fa95cba84996812a17165 (patch)
treef780edd6ae8df326a4a9013b0a2cd0f494bcc2d8 /mail
parent1f96a388bf6634fc934570022c5b2fd93da61323 (diff)
downloadgsoc2013-evolution-258ae9acd3fbaa82a03fa95cba84996812a17165.tar
gsoc2013-evolution-258ae9acd3fbaa82a03fa95cba84996812a17165.tar.gz
gsoc2013-evolution-258ae9acd3fbaa82a03fa95cba84996812a17165.tar.bz2
gsoc2013-evolution-258ae9acd3fbaa82a03fa95cba84996812a17165.tar.lz
gsoc2013-evolution-258ae9acd3fbaa82a03fa95cba84996812a17165.tar.xz
gsoc2013-evolution-258ae9acd3fbaa82a03fa95cba84996812a17165.tar.zst
gsoc2013-evolution-258ae9acd3fbaa82a03fa95cba84996812a17165.zip
Fix bug #309432 : RTL headers
svn path=/trunk/; revision=34780
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/em-format-html.c38
2 files changed, 34 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 4bf45fec17..38b2853ecd 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-08 Djihed Afifi <djihed@gmail.com>
+
+ ** Fix for bug #309432
+
+ * em-format-html.c: Fix message headers for RTL languages.
+
2008-01-08 Colin Leroy <colin@colino.net>
** Fix for bug #499145
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 1339aa8ec0..c272fd6d78 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1484,22 +1484,34 @@ efh_format_text_header (EMFormatHTML *emfh, CamelStream *stream, const char *lab
else
html = mhtml = camel_text_to_html (value, emfh->text_html_flags, 0);
+ gboolean is_rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;
if (emfh->simple_headers) {
fmt = "<b>%s</b>: %s<br>";
} else {
if (flags & EM_FORMAT_HTML_HEADER_NOCOLUMNS) {
- if (flags & EM_FORMAT_HEADER_BOLD)
+ if (flags & EM_FORMAT_HEADER_BOLD) {
fmt = "<tr><td><b>%s:</b> %s</td></tr>";
- else
+ } else {
fmt = "<tr><td>%s: %s</td></tr>";
+ }
} else if (flags & EM_FORMAT_HTML_HEADER_NODEC) {
- fmt = "<tr><th align=\"right\" valign=\"top\" nowrap>%s<b>&nbsp;</b></th><td valign=top>%s</td></tr>";
- } else {
-
- if (flags & EM_FORMAT_HEADER_BOLD)
- fmt = "<tr><th align=\"right\" valign=\"top\" nowrap>%s:<b>&nbsp;</b></th><td>%s</td></tr>";
+ if (is_rtl)
+ fmt = "<tr><td align=\"right\" valign=\"top\" width=\"100%%\">%2$s</td><th valign=top align=\"left\" nowrap>%1$s<b>&nbsp;</b></th></tr>";
else
- fmt = "<tr><td align=\"right\" valign=\"top\" nowrap>%s:<b>&nbsp;</b></td><td>%s</td></tr>";
+ fmt = "<tr><th align=\"right\" valign=\"top\" nowrap>%s<b>&nbsp;</b></th><td valign=top>%s</td></tr>";
+ } else {
+
+ if (flags & EM_FORMAT_HEADER_BOLD) {
+ if (is_rtl)
+ fmt = "<tr><td align=\"right\" valign=\"top\" width=\"100%%\">%2$s</td><th align=\"left\" nowrap>%1$s:<b>&nbsp;</b></th></tr>";
+ else
+ fmt = "<tr><th align=\"right\" valign=\"top\" nowrap>%s:<b>&nbsp;</b></th><td>%s</td></tr>";
+ } else {
+ if (is_rtl)
+ fmt = "<tr><td align=\"right\" valign=\"top\" width=\"100%\">%2$s</td><td align=\"left\" nowrap>%1$s:<b>&nbsp;</b></td></tr>";
+ else
+ fmt = "<tr><td align=\"right\" valign=\"top\" nowrap>%s:<b>&nbsp;</b></td><td>%s</td></tr>";
+ }
}
}
@@ -1838,7 +1850,10 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
if (header_sender && header_from && mail_from_delegate) {
camel_stream_printf(stream, "<tr><td><table border=1 width=\"100%%\" cellspacing=2 cellpadding=2><tr>");
- camel_stream_printf(stream, "<td align=\"left\" width=\"100%%\">");
+ if(gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
+ camel_stream_printf (stream, "<td align=\"right\" width=\"100%%\">");
+ else
+ camel_stream_printf (stream, "<td align=\"left\" width=\"100%%\">");
/* To translators: This message suggests to the receipients that the sender of the mail is
different from the one listed in From field.
*/
@@ -1853,7 +1868,10 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
g_free (header_sender);
g_free (header_from);
- camel_stream_printf(stream, "<tr><td><table border=0 cellpadding=\"0\">\n");
+ if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
+ camel_stream_printf (stream, "<tr><td><table width=\"100%%\" border=0 cellpadding=\"0\">\n");
+ else
+ camel_stream_printf (stream, "<tr><td><table border=0 cellpadding=\"0\">\n");
/* dump selected headers */
h = (EMFormatHeader *)emf->header_list.head;