bug 209097: Default mailto form subject should be localizable

patch by Chris Thomas (CTho) <cst@andrew.cmu.edu>, r=neil, sr=roc
This commit is contained in:
db48x%yahoo.com 2004-12-21 16:17:32 +00:00
parent 55d8f73bcb
commit 1eb67d2f10
2 changed files with 16 additions and 1 deletions

View File

@ -447,7 +447,21 @@ HandleMailtoSubject(nsCString& aPath) {
aPath.Append('?');
}
aPath.AppendLiteral("subject=Form%20Post%20From%20Mozilla&");
// Get the default subject
nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
if (NS_FAILED(rv))
return;
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://communicator/locale/layout/HtmlForm.properties",
getter_AddRefs(bundle));
if (NS_FAILED(rv))
return;
nsXPIDLString subjectStr;
bundle->GetStringFromName(NS_LITERAL_STRING("DefaultFormSubject").get(), getter_Copies(subjectStr));
aPath.AppendLiteral("subject=");
nsCString subjectStrEscaped;
aPath.Append(NS_EscapeURL(NS_ConvertUTF16toUTF8(subjectStr), esc_Query, subjectStrEscaped));
}
}

View File

@ -41,3 +41,4 @@ FileUpload=File Upload
IsIndexPrompt=This is a searchable index. Enter search keywords:
ForgotPostWarning=Form contains enctype=%S, but does not contain method=post. Submitting normally with method=GET and no enctype instead.
ForgotFileEnctypeWarning=Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form. The file will not be sent.
DefaultFormSubject=Form Post from Mozilla