Bug 1225752 - Localize the description of default summary. r=bz

This commit is contained in:
Ting-Yu Lin 2016-02-04 01:48:00 +08:00
parent 3433ddea0d
commit e7b4bc2880
2 changed files with 8 additions and 2 deletions

View File

@ -38,3 +38,7 @@ ColorPicker=Choose a color
# minus 20 and will always be a number equal to or greater than 2. So the
# singular case will never be used.
AndNMoreFiles=and one more;and #1 more
# LOCALIZATION NOTE (DefaultSummary): this string is shown on a <details> when
# it has no direct <summary> child. Google Chrome should already have this
# string translated.
DefaultSummary=Details

View File

@ -107,9 +107,11 @@ DetailsFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
nsIDOMNode::ELEMENT_NODE);
mDefaultSummary = new HTMLSummaryElement(nodeInfo);
// TODO: Need to localize this "Details" string in bug 1225752.
nsXPIDLString defaultSummaryText;
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
"DefaultSummary", defaultSummaryText);
RefPtr<nsTextNode> description = new nsTextNode(nodeInfoManager);
description->SetText(NS_LITERAL_STRING("Details"), false);
description->SetText(defaultSummaryText, false);
mDefaultSummary->AppendChildTo(description, false);
aElements.AppendElement(mDefaultSummary);