Bug 1893536 - Use more natural wording for Content Analysis error messages r=dlp-reviewers,fluent-reviewers,bolsson,handyman

Differential Revision: https://phabricator.services.mozilla.com/D208678
This commit is contained in:
Greg Stoll 2024-04-27 10:44:51 +00:00
Родитель 980812d29d
Коммит ee265b917d
2 изменённых файлов: 50 добавлений и 17 удалений

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

@ -642,6 +642,36 @@ export const ContentAnalysis = {
});
},
_getErrorDialogMessage(aResourceNameOrOperationType) {
if (aResourceNameOrOperationType.name) {
return this.l10n.formatValueSync(
"contentanalysis-error-message-upload-file",
{
filename: aResourceNameOrOperationType.name,
}
);
}
let l10nId = undefined;
switch (aResourceNameOrOperationType.operationType) {
case Ci.nsIContentAnalysisRequest.eClipboard:
l10nId = "contentanalysis-error-message-clipboard";
break;
case Ci.nsIContentAnalysisRequest.eDroppedText:
l10nId = "contentanalysis-error-message-dropped-text";
break;
case Ci.nsIContentAnalysisRequest.eOperationPrint:
l10nId = "contentanalysis-error-message-print";
break;
}
if (!l10nId) {
console.error(
"Unknown operationTypeForDisplay: ",
aResourceNameOrOperationType
);
return "";
}
return this.l10n.formatValueSync(l10nId);
},
_showSlowCABlockingMessage(
aBrowsingContext,
aRequestToken,
@ -799,12 +829,10 @@ export const ContentAnalysis = {
}
case Ci.nsIContentAnalysisResponse.eUnspecified:
message = await this.l10n.formatValue(
"contentanalysis-unspecified-error-message",
"contentanalysis-unspecified-error-message-content",
{
agent: lazy.agentName,
content: this._getResourceNameFromNameOrOperationType(
aResourceNameOrOperationType
),
content: this._getErrorDialogMessage(aResourceNameOrOperationType),
}
);
timeoutMs = this._RESULT_NOTIFICATION_TIMEOUT_MS;
@ -819,26 +847,25 @@ export const ContentAnalysis = {
);
return null;
case Ci.nsIContentAnalysisResponse.eNoAgent:
messageId = "contentanalysis-no-agent-connected-message";
messageId = "contentanalysis-no-agent-connected-message-content";
break;
case Ci.nsIContentAnalysisResponse.eInvalidAgentSignature:
messageId = "contentanalysis-invalid-agent-signature-message";
messageId =
"contentanalysis-invalid-agent-signature-message-content";
break;
case Ci.nsIContentAnalysisResponse.eErrorOther:
messageId = "contentanalysis-unspecified-error-message";
messageId = "contentanalysis-unspecified-error-message-content";
break;
default:
console.error(
"Unexpected CA cancelError value: " + aRequestCancelError
);
messageId = "contentanalysis-unspecified-error-message";
messageId = "contentanalysis-unspecified-error-message-content";
break;
}
message = await this.l10n.formatValue(messageId, {
agent: lazy.agentName,
content: this._getResourceNameFromNameOrOperationType(
aResourceNameOrOperationType
),
content: this._getErrorDialogMessage(aResourceNameOrOperationType),
});
timeoutMs = this._RESULT_NOTIFICATION_TIMEOUT_MS;
}

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

@ -47,16 +47,22 @@ contentanalysis-genericresponse-message = Content Analysis responded with { $res
contentanalysis-block-message = Your organization uses data-loss prevention software that has blocked this content: { $content }.
# Variables:
# $agent - The name of the DLP agent doing the analysis
# $content - Description of the content being blocked, such as "clipboard" or "aFile.txt"
contentanalysis-unspecified-error-message = An error occurred in communicating with { $agent }. Transfer denied for resource: { $content }.
# $content - Localized text describing the content being blocked, such as "Paste denied."
contentanalysis-unspecified-error-message-content = An error occurred in communicating with { $agent }. { $content }
# Variables:
# $agent - The name of the DLP agent doing the analysis
# $content - Description of the content being blocked, such as "clipboard" or "aFile.txt"
contentanalysis-no-agent-connected-message = Unable to connect to { $agent }. Transfer denied for resource: { $content }.
# $content - Localized text describing the content being blocked, such as "Paste denied."
contentanalysis-no-agent-connected-message-content = Unable to connect to { $agent }. { $content }
# Variables:
# $agent - The name of the DLP agent doing the analysis
# $content - Description of the content being blocked, such as "clipboard" or "aFile.txt"
contentanalysis-invalid-agent-signature-message = Failed signature verification for { $agent }. Transfer denied for resource: { $content }.
# $content - Localized text describing the content being blocked, such as "Paste denied."
contentanalysis-invalid-agent-signature-message-content = Failed signature verification for { $agent }. { $content }
# Variables:
# $filename - Name of the file that was blocked, such as "aFile.txt"
contentanalysis-error-message-upload-file = Upload of “{ $filename }” denied.
contentanalysis-error-message-dropped-text = Drag and drop denied.
contentanalysis-error-message-clipboard = Paste denied.
contentanalysis-error-message-print = Print denied.
contentanalysis-block-dialog-title-upload-file = Youre not permitted to upload this file
# Variables: