[dev] nowrap patch for displaying Chinese

Wenzhuo Zhang wenzhuo at zhmail.com
Sun Dec 5 18:56:13 PST 2004


Hi,

Web browsers tend to break a new line for each Chinese character if they
appear in a table cell (see the attached png file for an example). The
attachmed patch fixes this problem.

Best regards,

-- 
Wenzhuo Zhang <wenzhuo at zhmail.com>  GnuPG Key ID 0xBA586A68
Key fpr: 89C7 C6DE D956 F978 3F12  A8AF 5847 F840 BA58 6A68
-------------- next part --------------
Index: imp/templates/compose/compose.inc
===================================================================
RCS file: /repository/imp/templates/compose/compose.inc,v
retrieving revision 2.123.2.25
diff -u -r2.123.2.25 compose.inc
--- imp/templates/compose/compose.inc	27 Mar 2003 17:08:35 -0000	2.123.2.25
+++ imp/templates/compose/compose.inc	6 Dec 2004 02:47:31 -0000
@@ -65,7 +65,7 @@
 
 <?php if (!$prefs->isLocked('default_identity')): ?>
 <tr>
-    <td class="light" align="right"><b><?php echo _("Identity") ?>&nbsp;</b></td>
+    <td class="light" align="right" nowrap="nowrap"><b><?php echo _("Identity") ?>&nbsp;</b></td>
     <td class="item" align="left">
 
 <table border="0" width="100%" cellpadding="0">
@@ -80,7 +80,7 @@
     </td>
 <?php else: ?>
 <tr>
-    <td class="light" align="right"><b><?php echo _("From") ?>&nbsp;</b></td>
+    <td class="light" align="right" nowrap="nowrap"><b><?php echo _("From") ?>&nbsp;</b></td>
     <td class="item" align="left">
 
 <table border="0" width="100%" cellpadding="0">
@@ -103,7 +103,7 @@
 </tr>
 
 <tr>
-    <td class="light" align="right" valign="top"><b><?php echo _("To") ?>&nbsp;</b></td>
+    <td class="light" align="right" valign="top" nowrap="nowrap"><b><?php echo _("To") ?>&nbsp;</b></td>
     <td class="item" align="left">
 
 <table border="0" width="100%" cellpadding="0">
@@ -159,7 +159,7 @@
 
 <?php if ($conf['compose']['allow_cc']): ?>
 <tr>
-    <td class="light" align="right" valign="top"><b><?php echo _("Cc") ?>&nbsp;</b></td>
+    <td class="light" align="right" valign="top" nowrap="nowrap"><b><?php echo _("Cc") ?>&nbsp;</b></td>
     <td class="item" align="left">
 
 <table border="0" width="100%" cellpadding="0">
@@ -215,7 +215,7 @@
 
 <?php if ($conf['compose']['allow_bcc']): ?>
 <tr>
-    <td class="light" align="right" valign="top"><b><?php echo _("Bcc") ?>&nbsp;</b></td>
+    <td class="light" align="right" valign="top" nowrap="nowrap"><b><?php echo _("Bcc") ?>&nbsp;</b></td>
     <td class="item" align="left">
 
 <table border="0" width="100%" cellpadding="0">
@@ -270,7 +270,7 @@
 <?php endif; ?>
 
 <tr>
-    <td class="light" align="right"><b><?php echo _("Subject") ?>&nbsp;</b></td>
+    <td class="light" align="right" nowrap="nowrap"><b><?php echo _("Subject") ?>&nbsp;</b></td>
     <td class="item" align="left">
 
 <table border="0" width="100%" cellpadding="0">
@@ -288,7 +288,7 @@
 </tr>
 
 <tr>
-    <td class="light" align="right" valign="top"><b><?php echo _("Options") ?>&nbsp;</b></td>
+    <td class="light" align="right" valign="top" nowrap="nowrap"><b><?php echo _("Options") ?>&nbsp;</b></td>
     <td class="control">
 
 <table border="0" width="100%" cellspacing="0" cellpadding="0">
Index: imp/templates/login/login.inc
===================================================================
RCS file: /repository/imp/templates/login/login.inc,v
retrieving revision 2.92.2.15
diff -u -r2.92.2.15 login.inc
--- imp/templates/login/login.inc	5 Nov 2002 14:57:43 -0000	2.92.2.15
+++ imp/templates/login/login.inc	6 Dec 2004 02:47:39 -0000
@@ -66,14 +66,14 @@
         <tr><td align="center" colspan="2" class="light"><p class="light"><?php echo $reasons[$reason] ?></p></td></tr>
         <?php endif; ?>
 <tr>
-    <td align="right" class="light"><b><?php echo _("Username") ?></b></td>
+    <td align="right" class="light" nowrap="nowrap"><b><?php echo _("Username") ?></b></td>
     <td align="left"><input type="text" tabindex="1" name="imapuser" value="<?php echo htmlspecialchars(Horde::getFormData('imapuser', getenv('REMOTE_USER'))) ?>" /></td>
     <?php if (!empty($conf['hooks']['vinfo']) && function_exists($conf['hooks']['vinfo'])): ?>
     <td align="left" class="light"><b>@<?php echo call_user_func($conf['hooks']['vinfo'],'vdomain') ?></b></td>
     <?php endif; ?>
 </tr>
 <tr>
-    <td align="right" class="light"><b><?php echo _("Password") ?></b></td>
+    <td align="right" class="light" nowrap="nowrap"><b><?php echo _("Password") ?></b></td>
     <td align="left"><input type="password" tabindex="2" name="pass" /></td>
 </tr>
 
@@ -82,13 +82,13 @@
     <td><input type="hidden" name="server" value="<?php echo $server_key ?>" /></td>
 <?php elseif ($conf['server']['server_list'] == 'shown'): ?>
 <tr>
-    <td align="right" class="light"><b><?php echo _("Server") ?></b></td>
+    <td align="right" class="light" nowrap="nowrap"><b><?php echo _("Server") ?></b></td>
     <td class="light" align="left">
         <select tabindex="3" name="server"><?php echo $servers_list ?></select>
     </td>
 <?php elseif ($conf['server']['change_server']): ?>
 <tr>
-    <td align="right" class="light"><b><?php echo _("Server") ?></b></td>
+    <td align="right" class="light" nowrap="nowrap"><b><?php echo _("Server") ?></b></td>
     <td align="left" class="light">
         <input type="hidden" name="namespace" value="<?php echo $namespace_value ?>" />
         <input type="hidden" name="maildomain" value="<?php echo $maildomain_value ?>" />
@@ -127,7 +127,7 @@
 <?php if ($conf['server']['change_folders'] && $conf['server']['server_list'] == 'none'): ?>
 </tr>
 <tr>
-    <td align="right" class="light"><b><?php echo _("Folder Prefix") ?></b></td>
+    <td align="right" class="light" nowrap="nowrap"><b><?php echo _("Folder Prefix") ?></b></td>
     <td align="left"><input type="text" tabindex="3" name="folders" value="<?php echo Horde::getFormData('folders', $folders_value) ?>" /></td>
 </tr>
 <?php else: ?>
@@ -137,7 +137,7 @@
 
 <?php if (!$prefs->isLocked('language')): ?>
 <tr>
-    <td align="right" class="light"><b><?php echo _("Language") ?></b></td>
+    <td align="right" class="light" nowrap="nowrap"><b><?php echo _("Language") ?></b></td>
     <td align="left" class="light"><?php echo $langs ?></td>
 </tr>
 <?php endif; ?>
Index: imp/templates/message/headers.inc
===================================================================
RCS file: /repository/imp/templates/message/headers.inc,v
retrieving revision 2.22.2.2
diff -u -r2.22.2.2 headers.inc
--- imp/templates/message/headers.inc	16 Jul 2002 15:46:01 -0000	2.22.2.2
+++ imp/templates/message/headers.inc	6 Dec 2004 02:47:43 -0000
@@ -1,23 +1,23 @@
 <?php $i = 0; ?>
 <table border="0" align="center" width="100%" cellpadding="2" cellspacing="0">
 <?php if (isset($dat)): ?><tr>
-  <td class="item<?php echo$i?>" align="right" valign="top"><b><?php echo _("Date") ?>:</b>&nbsp;</td>
+  <td class="item<?php echo$i?>" nowrap="nowrap" align="right" valign="top"><b><?php echo _("Date") ?>:</b>&nbsp;</td>
   <td class="item<?php echo$i?>" width="100%"><?php echo $dat ?></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 <?php if (isset($frm)): ?><tr>
-  <td class="item<?php echo$i?>" align="right" valign="top"><b><?php echo _("From") ?>:</b>&nbsp;</td>
+  <td class="item<?php echo$i?>" nowrap="nowrap" align="right" valign="top"><b><?php echo _("From") ?>:</b>&nbsp;</td>
   <td class="item<?php echo$i?>" width="100%"><?php echo $frm ?></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 <?php if (isset($to)): ?><tr>
-  <td class="item<?php echo$i?>" align="right" valign="top"><b><?php echo _("To") ?>:</b>&nbsp;</td>
+  <td class="item<?php echo$i?>" nowrap="nowrap" align="right" valign="top"><b><?php echo _("To") ?>:</b>&nbsp;</td>
   <td class="item<?php echo$i?>" width="100%"><?php echo $to ?></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 <?php if (isset($cc)): ?><tr>
-  <td class="item<?php echo$i?>" align="right" valign="top"><b><?php echo _("Cc") ?>:</b>&nbsp;</td>
+  <td class="item<?php echo$i?>" nowrap="nowrap" align="right" valign="top"><b><?php echo _("Cc") ?>:</b>&nbsp;</td>
   <td class="item<?php echo$i?>" width="100%"><?php echo $cc ?></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 <?php if (isset($bcc)): ?><tr>
-  <td class="item<?php echo$i?>" align="right" valign="top"><b><?php echo _("Bcc") ?>:</b>&nbsp;</td>
+  <td class="item<?php echo$i?>" nowrap="nowrap" align="right" valign="top"><b><?php echo _("Bcc") ?>:</b>&nbsp;</td>
   <td class="item<?php echo$i?>" width="100%"><?php echo $bcc ?></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 <?php if (isset($rep) && (isset($rep)) && (!isset($frm) || $rep != $frm)): ?><tr>
@@ -25,11 +25,11 @@
   <td class="item<?php echo$i?>" width="100%"><?php echo $rep ?></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 <?php if (isset($sub)): ?><tr>
-  <td class="item<?php echo$i?>" align="right" valign="top"><b><?php echo _("Subject") ?>:</b>&nbsp;</td>
+  <td class="item<?php echo$i?>" nowrap="nowrap" align="right" valign="top"><b><?php echo _("Subject") ?>:</b>&nbsp;</td>
   <td class="item<?php echo$i?>" width="100%"><?php echo $sub ?></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 <?php if (!empty($atc)): ?><tr>
-  <td class="item<?php echo$i?>" align="right" valign="top"><b><?php echo _("Part(s)") ?>:</b>&nbsp;</td>
+  <td class="item<?php echo$i?>" nowrap="nowrap" align="right" valign="top"><b><?php echo _("Part(s)") ?>:</b>&nbsp;</td>
   <td class="item<?php echo$i?>" width="100%"><table cellspacing="2" cellpadding="1"><?php echo $atc ?></table></td>
 </tr><?php $i = ($i + 1) % 2; endif; ?>
 </table>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imp_chinese_display.png
Type: image/png
Size: 16933 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20041206/5ffaad8e/imp_chinese_display-0001.png


More information about the dev mailing list