Laurent Wacrenier writes:

Hi,

  I'm trying to translate sqwebmail 4.0.5 template to another language.

  I noticed that [#$DRAFTS=...#], [#$TRASH=...#] and [#$SENT=...#] tags
are not used. In list_folder_xlate() routing from folder.c, "Drafts",
"Trash" and "Sent" folder name are compared to "INBOX.Drafts",
etc. which never works.

  It occurs at least in folders.html, readmsg.html templates.

  Could this bug be fixed ?
  As theyre is multiple calls to list_folder_xlate and maybe some good
reason to compare with "INBOX." prefixed folder names, I'm unsure to
be able to make a clean fix. To patch list_folder_xlate() may be
enough but is the translation expected within non INBOX
directories ?

This happened as a result of internal refactoring for ACL support.

The following patch will fix it, except that the special folders in other accessible virtual mailboxes will not be translated.


Attachment: pgpyf7vi53hhh.pgp
Description: PGP signature

diff -U3 -r1.151 folder.c
--- folder.c    11 Jun 2004 22:43:06 -0000      1.151
+++ folder.c    18 Jun 2004 00:12:50 -0000
@@ -1055,6 +1055,7 @@
 }
 
 void list_folder_xlate(const char *p,
+                      const char *path,
                       const char *n_inbox,
                       const char *n_drafts,
                       const char *n_sent,
@@ -1069,7 +1070,7 @@
        else if (strcmp(p, INBOX "." SENT) == 0)
                printf("%s", n_sent);
        else
-               list_folder(p);
+               list_folder(path);
 }
 
 static void parse_hierarchy(const char *hierarchy,
@@ -4038,7 +4039,8 @@
                        if (strcmp(parentfolder, NEWSHAREDSP) == 0)
                                printf("%s", getarg("PUBLICFOLDERS"));
                        else
-                               list_folder_xlate(parentfolder+i,
+                               list_folder_xlate(parentfolder,
+                                                 parentfolder+i,
                                                  name_inbox,
                                                  name_drafts,
                                                  name_sent,
@@ -4204,7 +4206,8 @@
                                if (!t) enomem();
                                memcpy(t, shortname, p-shortname);
                                t[p-shortname]=0;
-                               list_folder_xlate(t,
+                               list_folder_xlate(folders[i],
+                                                 t,
                                                  name_inbox,
                                                  name_drafts,
                                                  name_sent,
@@ -4270,7 +4273,8 @@
                        printf("\">");
                }
 
-               list_folder_xlate(strcmp(folders[i], inbox_name) == 0
+               list_folder_xlate(folders[i],
+                                 strcmp(folders[i], inbox_name) == 0
                                  ? INBOX:shortname,
                                  name_inbox,
                                  name_drafts,

Attachment: pgpUJuHwdGNL2.pgp
Description: PGP signature

Reply via email to