Bug 1255542 - markupView.more.showAll should use a proper plural form. r=pbro, r=flod

This commit is contained in:
Michael Kohler 2016-03-15 14:25:00 +01:00
Родитель 05675cffff
Коммит b5c45cdf0a
2 изменённых файлов: 15 добавлений и 6 удалений

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

@ -59,6 +59,9 @@ loader.lazyGetter(this, "AutocompletePopup", () => {
return require("devtools/client/shared/autocomplete-popup").AutocompletePopup;
});
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
/**
* Vocabulary for the purposes of this file:
*
@ -1548,11 +1551,12 @@ MarkupView.prototype = {
}
if (!(children.hasFirst && children.hasLast)) {
let nodesCount = container.node.numChildren;
let showAllString = PluralForm.get(nodesCount,
this.strings.GetStringFromName("markupView.more.showAll2"));
let data = {
showing: this.strings.GetStringFromName("markupView.more.showing"),
showAll: this.strings.formatStringFromName(
"markupView.more.showAll",
[container.node.numChildren.toString()], 1),
showAll: showAllString.replace("#1", nodesCount),
allButtonClick: () => {
container.maxChildren = -1;
container.childrenDirty = true;

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

@ -42,12 +42,17 @@ inspector.accesskey=I
inspector.panelLabel=Inspector Panel
inspector.panelLabel.markupView=Markup View
# LOCALIZATION NOTE (markupView.more.*)
# LOCALIZATION NOTE (markupView.more.showing)
# When there are too many nodes to load at once, we will offer to
# show all the nodes.
# Keyboard shortcut for DOM and Style Inspector will shown inside brackets.
markupView.more.showing=Some nodes were hidden.
markupView.more.showAll=Show All %S Nodes
# LOCALIZATION NOTE (markupView.more.showAll2): Semi-colon list of plural forms.
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
markupView.more.showAll2=Show one more node;Show all #1 nodes
# LOCALIZATION NOTE (inspector.tooltip2)
# Keyboard shortcut for DOM and Style Inspector will be shown inside brackets.
inspector.tooltip2=DOM and Style Inspector (%S)
#LOCALIZATION NOTE: Used in the image preview tooltip when the image could not be loaded