Bug 1059220 - display window count of each application in applications list of the app share prompt, r=Gijs.

This commit is contained in:
Florian Quèze 2014-08-27 16:52:22 +02:00
parent 8ee2321e2c
commit 28d7fb03e9
2 changed files with 20 additions and 2 deletions

View File

@ -527,6 +527,12 @@ getUserMedia.noScreen.label = No Screen
getUserMedia.noWindow.label = No Window
getUserMedia.noAudio.label = No Audio
getUserMedia.shareEntireScreen.label = Entire screen
# LOCALIZATION NOTE (getUserMedia.shareApplicationWindowCount.label):
# Semicolon-separated list of plural forms.
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
# Replacement for #1 is the name of the application.
# Replacement for #2 is the number of windows currently displayed by the application.
getUserMedia.shareApplicationWindowCount.label=#1 (#2 window);#1 (#2 windows)
# LOCALIZATION NOTE (getUserMedia.shareSelectedDevices.label):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals

View File

@ -353,10 +353,22 @@ function prompt(aContentWindow, aCallID, aAudio, aVideo, aDevices, aSecure) {
let name;
// Screen has a special treatment because we currently only support
// sharing the primary screen and want to display a localized string.
if (type == "screen")
if (type == "screen") {
name = stringBundle.getString("getUserMedia.shareEntireScreen.label");
else
}
else {
name = devices[i].name;
if (type == "application") {
// The application names returned by the platform are of the form:
// <window count>\x1e<application name>
let sepIndex = name.indexOf("\x1e");
let count = name.slice(0, sepIndex);
let stringId = "getUserMedia.shareApplicationWindowCount.label";
name = PluralForm.get(parseInt(count), stringBundle.getString(stringId))
.replace("#1", name.slice(sepIndex + 1))
.replace("#2", count);
}
}
addDeviceToList(menupopup, name, i, typeName);
}