Closed Bug 66016 Opened 25 years ago Closed 24 years ago

Alert messages are hardcoded in nsMsgProtocol.cpp

Categories

(SeaMonkey :: MailNews: Message Display, defect)

Other
All
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jblanco, Assigned: mscott)

Details

Attachments

(9 files)

"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.
over to mailnews product and mscott
Assignee: asa → mscott
Component: Browser-General → Mail Window Front End
Product: Browser → MailNews
gonna try to patch this
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.
Are you saying that imapMsgs.properties should be removed and merged with messenger.properties?
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?
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.
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?
Keywords: approval, patch
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
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".
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)
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?
yay! sr=alecf
r=hwaara
a= asa@mozilla.org for checkin to 0.9.1 (on behalf of driver)
Fix checked in to branch and trunk.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified - fixed
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: