Bug 287695 fix hardcoded app name in default mailto: form subject

r=biesi sr=bz
This commit is contained in:
cst%andrew.cmu.edu 2005-04-03 17:16:28 +00:00
Родитель d32d35b284
Коммит f4ada571e2
4 изменённых файлов: 22 добавлений и 4 удалений

Просмотреть файл

@ -495,6 +495,7 @@ public:
eFORMS_PROPERTIES,
ePRINTING_PROPERTIES,
eDOM_PROPERTIES,
eBRAND_PROPERTIES,
PropertiesFile_COUNT
};
static nsresult ReportToConsole(PropertiesFile aFile,

Просмотреть файл

@ -2215,7 +2215,8 @@ static const char gPropertiesFiles[nsContentUtils::PropertiesFile_COUNT][56] = {
"chrome://global/locale/layout_errors.properties",
"chrome://global/locale/layout/HtmlForm.properties",
"chrome://global/locale/printing.properties",
"chrome://global/locale/dom/dom.properties"
"chrome://global/locale/dom/dom.properties",
"chrome://branding/locale/brand.properties"
};
/* static */ nsresult

Просмотреть файл

@ -447,11 +447,26 @@ HandleMailtoSubject(nsCString& aPath) {
}
// Get the default subject
nsXPIDLString brandName;
nsresult rv =
nsContentUtils::GetLocalizedString(nsContentUtils::eBRAND_PROPERTIES,
"brandShortName", brandName);
if (NS_FAILED(rv))
return;
const PRUnichar *formatStrings[] = { brandName.get() };
nsXPIDLString subjectStr;
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES, "DefaultFormSubject", subjectStr);
rv = nsContentUtils::FormatLocalizedString(
nsContentUtils::eFORMS_PROPERTIES,
"DefaultFormSubject",
formatStrings,
NS_ARRAY_LENGTH(formatStrings),
subjectStr);
if (NS_FAILED(rv))
return;
aPath.AppendLiteral("subject=");
nsCString subjectStrEscaped;
aPath.Append(NS_EscapeURL(NS_ConvertUTF16toUTF8(subjectStr), esc_Query, subjectStrEscaped));
aPath.Append(NS_EscapeURL(NS_ConvertUTF16toUTF8(subjectStr), esc_Query,
subjectStrEscaped));
}
}

Просмотреть файл

@ -41,4 +41,5 @@ 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
# LOCALIZATION NOTE (DefaultFormSubject): %S will be replaced with brandShortName
DefaultFormSubject=Form Post from %S