Closed
Bug 66016
Opened 25 years ago
Closed 24 years ago
Alert messages are hardcoded in nsMsgProtocol.cpp
Categories
(SeaMonkey :: MailNews: Message Display, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: jblanco, Assigned: mscott)
Details
Attachments
(9 files)
|
583 bytes,
patch
|
Details | Diff | Splinter Review | |
|
3.78 KB,
patch
|
Details | Diff | Splinter Review | |
|
822 bytes,
patch
|
Details | Diff | Splinter Review | |
|
4.07 KB,
patch
|
Details | Diff | Splinter Review | |
|
640 bytes,
patch
|
Details | Diff | Splinter Review | |
|
5.45 KB,
patch
|
Details | Diff | Splinter Review | |
|
5.29 KB,
patch
|
Details | Diff | Splinter Review | |
|
5.28 KB,
patch
|
Details | Diff | Splinter Review | |
|
5.28 KB,
patch
|
Details | Diff | Splinter Review |
"Failed to connect to the server", "Connection refused to the server",
"Connection to the server timed out", and "unknown error" are strings
in nsMsgProtocol.cpp so they are unable to be translated.
Comment 1•25 years ago
|
||
over to mailnews product and mscott
Assignee: asa → mscott
Component: Browser-General → Mail Window Front End
Product: Browser → MailNews
Comment 2•25 years ago
|
||
gonna try to patch this
| Reporter | ||
Comment 3•25 years ago
|
||
| Reporter | ||
Comment 4•25 years ago
|
||
Comment 5•25 years ago
|
||
hmm, I talked to sspitzer about this and he said they should be moved to
messenger.properties and we would change the code to read the imap errors from
the messenger.properties as well.
btw, you would need "unknown error" defined in the bundle as well, that should
be localisable as well.
| Reporter | ||
Comment 6•25 years ago
|
||
Are you saying that imapMsgs.properties should be removed and merged
with messenger.properties?
Comment 7•25 years ago
|
||
no, just perhaps the warning that are global to mailnews (not pop or imap
specific) should go into messenger.properties. cc: sspitzer
perhaps we should move the unknown error message to the default: switch as well?
| Reporter | ||
Comment 8•24 years ago
|
||
| Reporter | ||
Comment 9•24 years ago
|
||
| Reporter | ||
Comment 10•24 years ago
|
||
Comment 11•24 years ago
|
||
Jessica, the code looks great. But I have some suggestions before I can stamp
this with my r=;
+## @name UNKNOWN_ERROR
+## @loc None
As the other strings in that file don't use it, I think those (javadoc?)
comments are useless.
+#define UNKNOWN_ERROR 101
Remove the tabs used at that line.
Other than that, everything looks fine to me. Also, can you please run the cvs
diff comment in the highest common ancestor directory next time? That way all
these patches will fit in the same file.
When you fix this and apply the new patch, r=hwaara.
| Reporter | ||
Comment 12•24 years ago
|
||
Comment 13•24 years ago
|
||
I don't really understand your question, but I think your last patch looks good.
It's up to the super-reviewer of this patch to answer your question; Seth, Scott?
Comment 14•24 years ago
|
||
1) how old is your tree? nsIStringBundleService->CreateBundle no longer takes a
"locale" parameter
2) instead of giant nested if()'s, why don't you just return nsnull whenever
there is a failure?
3) you're leaking every string - you return with ToNewUnicode() but pass that
pointer directly to Alert()
4) You're using nsString as a local, automatic variable. use nsAutoString
5) resultString is declared within the scope of the function, rather than in the
place where it is used
6) you're using AssignWithConversion instead of using NS_LITERAL_STRING("foo").get()
7) you're only actually using resultString when ONE of the failure conditions
happens. Why not just return NULL from GetStringByID() and handle ITS failure by
setting up your [StringID###] string?
8) GetStringByID should be static, since it's not used anywhere else
| Reporter | ||
Comment 15•24 years ago
|
||
Alec, I have modified the code based on your comments. I
don't quite understand comment #6. I did pass back null
from the GetStringByID function and handle the failure
before the alert. Also added in the unknown error (aStatus)
after "Unknown Error".
| Reporter | ||
Comment 16•24 years ago
|
||
Comment 17•24 years ago
|
||
my comment #6 meant to replace this:
+ nsAutoString resultString;
+ resultString.AppendWithConversion("[StringID ");
+ resultString.AppendInt(errorID, 10);
+ resultString.AppendWithConversion("?]");
with:
+ nsAutoString resultString(NS_LITERAL_STRING("[StringID ");
+ resultString.AppendInt(errorID, 10);
+ resultString.Append(NS_LITERAL_STRING("?]"));
and similarly for errorString.
The other thing I forgot to mention is that you should be using nsCOMPtr<> for
the nsIStringBundle. On a side note, you should never call ->Release() directly,
you should always use NS_RELEASE() (though that will be a moot point when you
switch to nsCOMPtr)
| Reporter | ||
Comment 18•24 years ago
|
||
Comment 19•24 years ago
|
||
hate to say it, but you're still leaking an errorMsg, just noticed it - in the
handling for UNKNOWN_ERROR, you're dropping the old value when you assign a new one.
I wasn't going to comment on this, but since I'm here :) - why make an
additional char* pointer "propertyURL" to point to MSGS_URL? Why not just pass
in MSGS_URL directly to CreateBundle?
| Reporter | ||
Comment 20•24 years ago
|
||
Comment 21•24 years ago
|
||
yay! sr=alecf
Comment 22•24 years ago
|
||
r=hwaara
Comment 23•24 years ago
|
||
a= asa@mozilla.org for checkin to 0.9.1
(on behalf of driver)
Comment 24•24 years ago
|
||
Fix checked in to branch and trunk.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•