Bug 838699 - Move the "Browse" button l10n to nsFileControlFrame.cpp. r=bz

This commit is contained in:
Mounir Lamouri
2013-02-09 10:48:20 +00:00
parent 06d97d4c0d
commit ef70012ec2
3 changed files with 6 additions and 23 deletions

View File

@@ -117,6 +117,12 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
mBrowse->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
NS_LITERAL_STRING("button"), false);
// Set the file picking button text depending on the current locale.
nsXPIDLString buttonValue;
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
"Browse", buttonValue);
mBrowse->SetAttr(kNameSpaceID_None, nsGkAtoms::value, buttonValue, false);
// Make sure access key and tab order for the element actually redirect to the
// file picking button.
nsCOMPtr<nsIDOMHTMLInputElement> fileContent = do_QueryInterface(mContent);