From 976b5d7d73e3e3f7aa0e0dee23a6f0df540c877d Mon Sep 17 00:00:00 2001 From: Erica Wright Date: Mon, 18 Nov 2019 19:08:58 +0000 Subject: [PATCH] Bug 1581426 - Update Lockwise connected devices string. r=fluent-reviewers,nhnt11,flod Differential Revision: https://phabricator.services.mozilla.com/D53080 --HG-- extra : moz-landing-system : lando --- .../components/protections/content/lockwise-card.js | 13 ++++--------- .../components/protections/content/protections.html | 2 +- .../test/browser/browser_protections_lockwise.js | 2 +- browser/locales/en-US/browser/protections.ftl | 9 ++++----- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/browser/components/protections/content/lockwise-card.js b/browser/components/protections/content/lockwise-card.js index 079a22021b1d..ac13edfa690b 100644 --- a/browser/components/protections/content/lockwise-card.js +++ b/browser/components/protections/content/lockwise-card.js @@ -140,15 +140,10 @@ export default class LockwiseCard { const syncedDevicesText = container.querySelector(".synced-devices-text"); const textEl = syncedDevicesText.querySelector("span"); - if (syncedDevices) { - textEl.setAttribute( - "data-l10n-args", - JSON.stringify({ count: syncedDevices }) - ); - textEl.setAttribute("data-l10n-id", "lockwise-sync-status"); - } else { - textEl.setAttribute("data-l10n-id", "lockwise-sync-not-syncing-devices"); - } + document.l10n.setAttributes(textEl, "lockwise-connected-device-status", { + count: syncedDevices, + }); + // Display the link for enabling sync if no synced devices are detected. if (syncedDevices === 0) { const syncLink = this.doc.getElementById("turn-on-sync"); diff --git a/browser/components/protections/content/protections.html b/browser/components/protections/content/protections.html index 1fc064f330f7..fa56a6209489 100644 --- a/browser/components/protections/content/protections.html +++ b/browser/components/protections/content/protections.html @@ -227,7 +227,7 @@ - + diff --git a/browser/components/protections/test/browser/browser_protections_lockwise.js b/browser/components/protections/test/browser/browser_protections_lockwise.js index 15e95ceb3465..3df4341aece6 100644 --- a/browser/components/protections/test/browser/browser_protections_lockwise.js +++ b/browser/components/protections/test/browser/browser_protections_lockwise.js @@ -124,7 +124,7 @@ add_task(async function() { ); is( syncedDevicesStatusText.getAttribute("data-l10n-id"), - "lockwise-sync-not-syncing-devices", + "lockwise-connected-device-status", "Not syncing to other devices." ); diff --git a/browser/locales/en-US/browser/protections.ftl b/browser/locales/en-US/browser/protections.ftl index 3f4b8568fb2e..c3cbd6333497 100644 --- a/browser/locales/en-US/browser/protections.ftl +++ b/browser/locales/en-US/browser/protections.ftl @@ -79,16 +79,15 @@ lockwise-passwords-stored = turn-on-sync = Turn on { -sync-brand-short-name }… .title = Go to sync preferences -manage-devices = Manage devices +manage-connected-devices = Manage devices… # Variables: # $count (Number) - Number of devices connected with sync. -lockwise-sync-status = +lockwise-connected-device-status = { $count -> - [one] Syncing to { $count } other device - *[other] Syncing to { $count } other devices + [one] Connected to { $count } device + *[other] Connected to { $count } devices } -lockwise-sync-not-syncing-devices = Not syncing to other devices monitor-title = Look out for data breaches monitor-link = How it works