From adc976974a8eecdfd1d4124155f66e73df3c0412 Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Tue, 6 Jun 2023 14:39:22 +0000 Subject: [PATCH] Bug 1826060 - Expose FedCM copy to localization r=anti-tracking-reviewers,fluent-reviewers,flod,timhuang Differential Revision: https://phabricator.services.mozilla.com/D178443 --- browser/base/content/browser.xhtml | 1 - .../en-US/browser}/identityCredentialNotification.ftl | 8 ++++++-- browser/locales/jar.mn | 1 - dom/docs/fedcm.rst | 2 +- .../IdentityCredentialPromptService.sys.mjs | 6 +++--- 5 files changed, 10 insertions(+), 8 deletions(-) rename browser/{components/credentialmanager => locales/en-US/browser}/identityCredentialNotification.ftl (75%) diff --git a/browser/base/content/browser.xhtml b/browser/base/content/browser.xhtml index 4ec9628c17dc..f9953d555fb3 100644 --- a/browser/base/content/browser.xhtml +++ b/browser/base/content/browser.xhtml @@ -88,7 +88,6 @@ - diff --git a/browser/components/credentialmanager/identityCredentialNotification.ftl b/browser/locales/en-US/browser/identityCredentialNotification.ftl similarity index 75% rename from browser/components/credentialmanager/identityCredentialNotification.ftl rename to browser/locales/en-US/browser/identityCredentialNotification.ftl index fabe65f96aac..a5ce9a064516 100644 --- a/browser/components/credentialmanager/identityCredentialNotification.ftl +++ b/browser/locales/en-US/browser/identityCredentialNotification.ftl @@ -3,12 +3,16 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. ## Credential panel +## +## Identity providers are websites you use to log in to another website, for +## example: Google when you Log in with Google. +## +## Variables: ## $host (String): the hostname of the site that is being displayed. ## $provider (String): the hostname of another website you are using to log in to the site being displayed identity-credential-header-providers = Sign in with a login provider identity-credential-header-accounts = Sign in with { $provider } -# Identity providers are websites you use to log into another website, for example: Google when you Log in with Google. identity-credential-urlbar-anchor = .tooltiptext = Open login panel identity-credential-cancel-button = @@ -21,4 +25,4 @@ identity-credential-sign-in-button = .label = Sign In .accesskey = S identity-credential-policy-title = Use { $provider } as a login provider -identity-credential-policy-description = Logging in to { $host } with a { $provider } account is subject to { $provider }’s and . +identity-credential-policy-description = Logging in to { $host } with a { $provider } account is subject to their and . diff --git a/browser/locales/jar.mn b/browser/locales/jar.mn index d4ef1dd08dd3..9523dc7815e8 100644 --- a/browser/locales/jar.mn +++ b/browser/locales/jar.mn @@ -12,7 +12,6 @@ preview/protections.ftl (../components/protections/content/protections.ftl) preview/interventions.ftl (../components/urlbar/content/interventions.ftl) preview/firefoxSuggest.ftl (../components/urlbar/content/firefoxSuggest.ftl) - preview/identityCredentialNotification.ftl (../components/credentialmanager/identityCredentialNotification.ftl) preview/stripOnShare.ftl (../components/urlbar/content/stripOnShare.ftl) browser (%browser/**/*.ftl) diff --git a/dom/docs/fedcm.rst b/dom/docs/fedcm.rst index 64f4763d79f3..4ec2e8c8d164 100644 --- a/dom/docs/fedcm.rst +++ b/dom/docs/fedcm.rst @@ -19,7 +19,7 @@ The service for managing state associated with IdentityCredentials is ``Identity The UI panel is spread around a little. The actual DOM elements are in the HTML subtree with root at ``#identity-credential-notification`` in ``browser/base/content/popup-notifications.inc``. But the CSS describing it is spread through ``browser/themes/shared/customizableui/panelUI-shared.css``, ``browser/themes/shared/identity-credential-notification.css``, and ``browser/themes/shared/notification-icons.css``. Generally speaking, search for ``identity-credential`` in those files to find the relevant ids and classes. -Temporary content strings, which will be moved when included in i18n: ``browser/components/credentialmanager/identityCredentialNotification.ftl``, for now. This will eventually be moved to ``browser/locales/en-US/browser/``. +Content strings: ``browser/locales/en-US/browser/identityCredentialNotification.ftl``. All of this is entered from the ``navigator.credentials`` object, implemented in ``dom/credentialmanagement/CredentialsContainer.{cpp,h}``. diff --git a/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs b/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs index 6ddc3d9ded7b..156a758a162d 100644 --- a/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs +++ b/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs @@ -139,7 +139,7 @@ export class IdentityCredentialPromptService { // Localize all strings to be used // Bug 1797154 - Convert localization calls to use the async formatValues. let localization = new Localization( - ["preview/identityCredentialNotification.ftl"], + ["browser/identityCredentialNotification.ftl"], true ); let headerMessage = localization.formatValueSync( @@ -316,7 +316,7 @@ export class IdentityCredentialPromptService { // Localize the description // Bug 1797154 - Convert localization calls to use the async formatValues. let localization = new Localization( - ["preview/identityCredentialNotification.ftl"], + ["browser/identityCredentialNotification.ftl"], true ); let [accept, cancel] = localization.formatMessagesSync([ @@ -460,7 +460,7 @@ export class IdentityCredentialPromptService { // Localize all strings to be used // Bug 1797154 - Convert localization calls to use the async formatValues. let localization = new Localization( - ["preview/identityCredentialNotification.ftl"], + ["browser/identityCredentialNotification.ftl"], true ); let providerURL = new URL(provider.configURL);