Bug 1295914, improve the label of the button of folder picker, r=baku,mstange,karlt,jimm
This commit is contained in:
@@ -938,9 +938,14 @@ HTMLInputElement::InitFilePicker(FilePickerType aType)
|
||||
|
||||
// Get Loc title
|
||||
nsXPIDLString title;
|
||||
nsXPIDLString okButtonLabel;
|
||||
if (aType == FILE_PICKER_DIRECTORY) {
|
||||
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
|
||||
"DirectoryUpload", title);
|
||||
|
||||
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
|
||||
"DirectoryPickerOkButtonLabel",
|
||||
okButtonLabel);
|
||||
} else {
|
||||
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
|
||||
"FileUpload", title);
|
||||
@@ -963,6 +968,10 @@ HTMLInputElement::InitFilePicker(FilePickerType aType)
|
||||
nsresult rv = filePicker->Init(win, title, mode);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!okButtonLabel.IsEmpty()) {
|
||||
filePicker->SetOkButtonLabel(okButtonLabel);
|
||||
}
|
||||
|
||||
// Native directory pickers ignore file type filters, so we don't spend
|
||||
// cycles adding them for FILE_PICKER_DIRECTORY.
|
||||
if (HasAttr(kNameSpaceID_None, nsGkAtoms::accept) &&
|
||||
|
||||
Reference in New Issue
Block a user