Bug 1581428 - Show tooltips for links in Protection Report. r=fluent-reviewers,johannh,flod

Differential Revision: https://phabricator.services.mozilla.com/D46215

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Erica Wright 2019-09-18 12:33:08 +00:00
parent 374680fc66
commit 049e9d1b0b
4 changed files with 46 additions and 16 deletions

View File

@ -33,7 +33,7 @@
<div>
<h2 class="card-title" data-l10n-id="etp-card-title"></h2>
<p class="content" data-l10n-id="etp-card-content"></p>
<p id="protection-details" role="link" tabindex="0" data-l10n-title="go-to-privacy-settings"></p>
<p id="protection-details" role="link" tabindex="0"></p>
</div>
</div>
<div class="card-body">
@ -171,7 +171,7 @@
<!-- Display number of exposed stored passwords here. -->
</span>
<span id="password-warning">
<a target="_blank" href="about:logins" id="lockwise-link" data-l10n-name="lockwise-link" data-l10n-title="go-to-saved-logins"></a>
<a target="_blank" href="about:logins" id="lockwise-link" data-l10n-name="lockwise-link"></a>
</span>
</div>
</div>
@ -191,7 +191,7 @@
<!-- Insert Lockwise header content here. -->
</p>
</div>
<button id="open-about-logins-button" class="primary" data-l10n-id="about-logins-view-logins-button" data-l10n-title="go-to-saved-logins"></button>
<button id="open-about-logins-button" class="primary" data-l10n-id="protection-report-view-logins-button"></button>
</div>
</div>
<div class="card-body hidden">

View File

@ -41,17 +41,17 @@ document.addEventListener("DOMContentLoaded", e => {
if (cbCategory == "custom") {
protectionDetails.setAttribute(
"data-l10n-id",
"protection-header-details-custom"
"protection-report-header-details-custom"
);
} else if (cbCategory == "strict") {
protectionDetails.setAttribute(
"data-l10n-id",
"protection-header-details-strict"
"protection-report-header-details-strict"
);
} else {
protectionDetails.setAttribute(
"data-l10n-id",
"protection-header-details-standard"
"protection-report-header-details-standard"
);
}

View File

@ -23,9 +23,12 @@ graph-total-tracker-summary =
# The terminology used to refer to categories of Content Blocking is also used in chrome/browser/browser.properties and should be translated consistently.
# "Standard" in this case is an adjective, meaning "default" or "normal".
# The category name in the <b> tag will be bold.
protection-header-details-standard = Protection Level is set to <b>Standard</b>
protection-header-details-strict = Protection Level is set to <b>Strict</b>
protection-header-details-custom = Protection Level is set to <b>Custom</b>
protection-report-header-details-standard = Protection Level is set to <b>Standard</b>
.title = Go to Privacy Settings
protection-report-header-details-strict = Protection Level is set to <b>Strict</b>
.title = Go to Privacy Settings
protection-report-header-details-custom = Protection Level is set to <b>Custom</b>
.title = Go to Privacy Settings
protection-report-page-title = Privacy Protections
protection-report-content-title = Privacy Protections
@ -58,7 +61,8 @@ lockwise-title = Never forget a password again
lockwise-title-logged-in = { -lockwise-brand-name }
lockwise-header-content = { -lockwise-brand-name } securely stores your passwords in your browser.
lockwise-header-content-logged-in = Securely store and sync your passwords to all your devices.
about-logins-view-logins-button = View Logins
protection-report-view-logins-button = View Logins
.title = Go to Saved Logins
lockwise-no-logins-content = Get the <a data-l10n-name="lockwise-inline-link">{ -lockwise-brand-name }</a> app to take your passwords everywhere.
# This string is displayed after a large numeral that indicates the total number
@ -129,12 +133,6 @@ password-warning =
*[other] Saved logins may have been exposed in a data breach. Change these passwords for better online security. <a data-l10n-name="lockwise-link">View Saved Logins</a>
}
# This is the title attribute describing the graph report's link to about:settings#privacy
go-to-privacy-settings = Go to Privacy Settings
# This is the title attribute describing the Lockwise card's link to about:logins
go-to-saved-logins = Go to Saved Logins
## The title attribute is used to display the type of protection.
## The aria-label is spoken by screen readers to make the visual graph accessible to blind users.
##

View File

@ -0,0 +1,32 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from
from fluent.migrate import COPY_PATTERN
TARGET_FILE = "browser/browser/protections.ftl"
SOURCE_FILE = TARGET_FILE
def migrate(ctx):
"""Bug 1581428 - Show tooltips for links in Protection Report, part {index}."""
ctx.add_transforms(
TARGET_FILE,
SOURCE_FILE,
transforms_from(
"""
protection-report-header-details-standard = {COPY_PATTERN(from_path, "protection-header-details-standard")}
.title = {COPY_PATTERN(from_path, "go-to-privacy-settings")}
protection-report-header-details-strict = {COPY_PATTERN(from_path, "protection-header-details-strict")}
.title = {COPY_PATTERN(from_path, "go-to-privacy-settings")}
protection-report-header-details-custom = {COPY_PATTERN(from_path, "protection-header-details-custom")}
.title = {COPY_PATTERN(from_path, "go-to-privacy-settings")}
protection-report-view-logins-button = {COPY_PATTERN(from_path, "about-logins-view-logins-button")}
.title = {COPY_PATTERN(from_path, "go-to-saved-logins")}
""",
from_path=SOURCE_FILE),
)