Bug 1319112 - Adjust strings for the WebRTC permission notifications. r=florian

MozReview-Commit-ID: 98jRli5Cqxy

--HG--
extra : rebase_source : b3dc18f98c2749c75ccac910693033993e267e2f
This commit is contained in:
Paolo Amadini 2017-01-16 14:31:23 +01:00
Родитель 10a83ad659
Коммит e33311d3f7
2 изменённых файлов: 39 добавлений и 15 удалений

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

@ -476,18 +476,22 @@ social.error.closeSidebar.accesskey=C
# LOCALIZATION NOTE: %1$S is the label for the toolbar button, %2$S is the associated badge numbering that the social provider may provide.
social.aria.toolbarButtonBadgeText=%1$S (%2$S)
# LOCALIZATION NOTE (getUserMedia.shareCamera2.message, getUserMedia.shareMicrophone2.message,
# getUserMedia.shareScreen2.message, getUserMedia.shareCameraAndMicrophone2.message,
# getUserMedia.shareScreenAndMicrophone2.message, getUserMedia.shareCameraAndAudioCapture2.message,
# getUserMedia.shareAudioCapture2.message, getUserMedia.shareScreenAndAudioCapture2.message):
# %S is the website origin (e.g. www.mozilla.org)
# LOCALIZATION NOTE (getUserMedia.shareCamera2.message,
# getUserMedia.shareMicrophone2.message,
# getUserMedia.shareScreen3.message,
# getUserMedia.shareCameraAndMicrophone2.message,
# getUserMedia.shareCameraAndAudioCapture2.message,
# getUserMedia.shareScreenAndMicrophone3.message,
# getUserMedia.shareScreenAndAudioCapture3.message,
# getUserMedia.shareAudioCapture2.message):
# %S is the website origin (e.g. www.mozilla.org)
getUserMedia.shareCamera2.message = Will you allow %S to use your camera?
getUserMedia.shareMicrophone2.message = Will you allow %S to use your microphone?
getUserMedia.shareScreen2.message = Will you allow %S to see your screen or application window?
getUserMedia.shareScreen3.message = Will you allow %S to see your screen?
getUserMedia.shareCameraAndMicrophone2.message = Will you allow %S to use your camera and microphone?
getUserMedia.shareCameraAndAudioCapture2.message = Will you allow %S to use your camera and listen to this tabs audio?
getUserMedia.shareScreenAndMicrophone2.message = Will you allow %S to use your microphone and see your screen or application window?
getUserMedia.shareScreenAndAudioCapture2.message = Will you allow %S to listen to this tabs audio and see your screen or application window?
getUserMedia.shareScreenAndMicrophone3.message = Will you allow %S to use your microphone and see your screen?
getUserMedia.shareScreenAndAudioCapture3.message = Will you allow %S to listen to this tabs audio and see your screen?
getUserMedia.shareAudioCapture2.message = Will you allow %S to listen to this tabs audio?
# LOCALIZATION NOTE (getUserMedia.shareScreenWarning.message): NB: inserted via innerHTML, so please don't use <, > or & in this string.
# %S will be the 'learn more' link
@ -518,16 +522,20 @@ getUserMedia.shareMonitor.label = Screen %S
# 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.allow.label,
# getUserMedia.dontAllow.label):
# These two buttons are the possible answers to the various prompts in the
# "getUserMedia.share{device}.message" strings.
getUserMedia.allow.label = Allow
getUserMedia.allow.accesskey = A
getUserMedia.dontAllow.label = Dont Allow
getUserMedia.dontAllow.accesskey = D
getUserMedia.remember=Remember this decision
# LOCALIZATION NOTE (ggetUserMedia.reasonForNoPermanentAllow.screen,
# LOCALIZATION NOTE (getUserMedia.reasonForNoPermanentAllow.screen2,
# getUserMedia.reasonForNoPermanentAllow.audio,
# getUserMedia.reasonForNoPermanentAllow.insecure):
# %S is brandShortName
getUserMedia.reasonForNoPermanentAllow.screen=%S can not allow permanent access to your screen or application without asking which one to share.
getUserMedia.reasonForNoPermanentAllow.screen2=%S can not allow permanent access to your screen without asking which one to share.
getUserMedia.reasonForNoPermanentAllow.audio=%S can not allow permanent access to your tabs audio without asking which tab to share.
getUserMedia.reasonForNoPermanentAllow.insecure=Your connection to this site is not secure. To protect you, %S will only allow access for this session.

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

@ -333,14 +333,30 @@ function getHost(uri, href) {
}
function prompt(aBrowser, aRequest) {
let {audioDevices: audioDevices, videoDevices: videoDevices,
sharingScreen: sharingScreen, sharingAudio: sharingAudio,
requestTypes: requestTypes} = aRequest;
let { audioDevices, videoDevices, sharingScreen, sharingAudio,
requestTypes } = aRequest;
let uri = Services.io.newURI(aRequest.documentURI);
let host = getHost(uri);
let chromeDoc = aBrowser.ownerDocument;
let stringBundle = chromeDoc.defaultView.gNavigatorBundle;
let stringId = "getUserMedia.share" + requestTypes.join("And") + "2.message";
// Mind the order, because for simplicity we're iterating over the list using
// "includes()". This allows the rotation of string identifiers. We list the
// full identifiers here so they can be cross-referenced more easily.
let joinedRequestTypes = requestTypes.join("And");
let stringId = [
// Individual request types first.
"getUserMedia.shareCamera2.message",
"getUserMedia.shareMicrophone2.message",
"getUserMedia.shareScreen3.message",
"getUserMedia.shareAudioCapture2.message",
// Combinations of the above request types last.
"getUserMedia.shareCameraAndMicrophone2.message",
"getUserMedia.shareCameraAndAudioCapture2.message",
"getUserMedia.shareScreenAndMicrophone3.message",
"getUserMedia.shareScreenAndAudioCapture3.message",
].find(id => id.includes(joinedRequestTypes));
let message = stringBundle.getFormattedString(stringId, [host]);
let notification; // Used by action callbacks.
@ -377,7 +393,7 @@ function prompt(aBrowser, aRequest) {
// share without prompting).
let reasonForNoPermanentAllow = "";
if (sharingScreen) {
reasonForNoPermanentAllow = "getUserMedia.reasonForNoPermanentAllow.screen";
reasonForNoPermanentAllow = "getUserMedia.reasonForNoPermanentAllow.screen2";
} else if (sharingAudio) {
reasonForNoPermanentAllow = "getUserMedia.reasonForNoPermanentAllow.audio";
} else if (!aRequest.secure) {