diff --git a/app/views/shared/_banner-lock-icon.html.erb b/app/views/shared/_banner-lock-icon.html.erb deleted file mode 100644 index e4da7888a37..00000000000 --- a/app/views/shared/_banner-lock-icon.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%= image_tag( - asset_path('lock.svg'), - width: 9, - height: 12, - class: 'usa-banner__lock-image', - alt: t('shared.banner.lock_description'), - ) %> diff --git a/app/views/shared/_banner.html.erb b/app/views/shared/_banner.html.erb index 90966378a74..a78a8a8ad44 100644 --- a/app/views/shared/_banner.html.erb +++ b/app/views/shared/_banner.html.erb @@ -49,7 +49,17 @@

<%= t('shared.banner.secure_heading') %> -
<%= t('shared.banner.secure_description_html', lock_icon: render('shared/banner-lock-icon')) %> +
+ <%= t( + 'shared.banner.secure_description_html', + lock_icon: image_tag( + asset_path('lock.svg'), + width: 9, + height: 12, + class: 'usa-banner__lock-image', + alt: t('shared.banner.lock_description'), + ), + ) %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 12bca298e3d..495bf80a679 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1561,7 +1561,7 @@ shared.banner.how: Here’s how you know shared.banner.landmark_label: Official government website shared.banner.lock_description: A locked padlock shared.banner.official_site: An official website of the United States government -shared.banner.secure_description_html: A lock ( %{lock_icon} ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites. +shared.banner.secure_description_html: A lock ( %{lock_icon} ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites. shared.banner.secure_heading: Secure .gov websites use HTTPS shared.footer_lite.gsa: US General Services Administration shared.skip_link: Skip to main content diff --git a/config/locales/es.yml b/config/locales/es.yml index fdb2809ec22..df399648e4c 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1573,7 +1573,7 @@ shared.banner.how: Así es como usted puede saberlo shared.banner.landmark_label: Sitio web oficial del Gobierno shared.banner.lock_description: Un candado cerrado shared.banner.official_site: Un sitio web oficial del Gobierno de los Estados Unidos -shared.banner.secure_description_html: Un candado ( %{lock_icon} ) o https:// significa que se conectó de forma segura a un sitio web .gov. Comunique información confidencial solo en los sitios web oficiales protegidos. +shared.banner.secure_description_html: Un candado ( %{lock_icon} ) o https:// significa que se conectó de forma segura a un sitio web .gov. Comunique información confidencial solo en los sitios web oficiales protegidos. shared.banner.secure_heading: Los sitios web .gov protegidos usan HTTPS shared.footer_lite.gsa: Administración General de Servicios de los EE. UU. shared.skip_link: Saltar al contenido principal diff --git a/config/locales/fr.yml b/config/locales/fr.yml index c54c7df6c95..bbd008bd2c2 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1477,11 +1477,11 @@ notices.signed_up_but_unconfirmed.first_paragraph_end: avec un lien pour confirm notices.signed_up_but_unconfirmed.first_paragraph_start: Nous avons envoyé un e-mail à notices.signed_up_but_unconfirmed.resend_confirmation_email: Renvoyer le courriel de confirmation notices.timeout_warning.partially_signed_in.continue: Continuer la connexion -notices.timeout_warning.partially_signed_in.live_region_message_html: Vous serez déconnecté dans %{time_left_in_session_html}. Sélectionnez « Gardez ma connexion active » pour rester connecté. Sélectionnez « Déconnectez-moi » pour vous déconnecter. +notices.timeout_warning.partially_signed_in.live_region_message_html: Vous serez déconnecté dans %{time_left_in_session_html}. Sélectionnez « Gardez ma connexion active » pour rester connecté. Sélectionnez « Déconnectez-moi » pour vous déconnecter. notices.timeout_warning.partially_signed_in.message_html: Pour votre sécurité, nous annulerons votre connexion dans %{time_left_in_session_html}. notices.timeout_warning.partially_signed_in.sign_out: Annuler la connexion notices.timeout_warning.signed_in.continue: Gardez ma connexion active -notices.timeout_warning.signed_in.live_region_message_html: Vous serez déconnecté dans %{time_left_in_session_html}. Sélectionnez « Gardez ma connexion active » pour rester connecté. Sélectionnez « Déconnectez-moi » pour vous déconnecter. +notices.timeout_warning.signed_in.live_region_message_html: Vous serez déconnecté dans %{time_left_in_session_html}. Sélectionnez « Gardez ma connexion active » pour rester connecté. Sélectionnez « Déconnectez-moi » pour vous déconnecter. notices.timeout_warning.signed_in.message_html: Pour votre sécurité, nous vous déconnecterons dans %{time_left_in_session_html}, sauf en cas d’avis contraire de votre part. notices.timeout_warning.signed_in.sign_out: Déconnectez-moi notices.totp_configured: Une appli d’authentification a été ajoutée à votre compte. @@ -1561,7 +1561,7 @@ shared.banner.how: Voici comment le savoir shared.banner.landmark_label: Site Web officiel des autorités shared.banner.lock_description: Un cadenas fermé shared.banner.official_site: Un site Web officiel de l’administration des États-Unis -shared.banner.secure_description_html: La présence d’un cadenas ( %{lock_icon} ) ou de https:// signifie que vous êtes connecté en toute sécurité au site Web .gov. Ne partagez des informations sensibles que sur des sites Web officiels et sécurisés. +shared.banner.secure_description_html: La présence d’un cadenas ( %{lock_icon} ) ou de https:// signifie que vous êtes connecté en toute sécurité au site Web .gov. Ne partagez des informations sensibles que sur des sites Web officiels et sécurisés. shared.banner.secure_heading: Les sites Web sécurisés .gov utilisent HTTPS shared.footer_lite.gsa: Administration des services généraux des États-Unis shared.skip_link: Passer au contenu principal diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4ded70cec3f..a0f0cae7e0a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1574,7 +1574,7 @@ shared.banner.how: 这里告诉你如何知道 shared.banner.landmark_label: 官方政府网站 shared.banner.lock_description: 锁上的锁头 shared.banner.official_site: 美国政府的一个官方网站 -shared.banner.secure_description_html: 一把 ( %{lock_icon} )或者 https:// 意味着你已安全连接到 .gov 网站。只在官方、安全的网站上分享敏感信息。 +shared.banner.secure_description_html: 一把 ( %{lock_icon} )或者 https:// 意味着你已安全连接到 .gov 网站。只在官方、安全的网站上分享敏感信息。 shared.banner.secure_heading: 安全的 .gov 网站使用 HTTPS shared.footer_lite.gsa: 美国联邦总务管理局 shared.skip_link: 跳到主要内容 diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb index 11f98f4fe9d..ed65be38544 100644 --- a/spec/i18n_spec.rb +++ b/spec/i18n_spec.rb @@ -24,6 +24,7 @@ '<' => '>', '(' => ')', '“' => '”', + '«' => '»', }.freeze # A set of patterns which are expected to only occur within specific locales. This is an imperfect @@ -182,6 +183,35 @@ def allowed_untranslated_key?(locale, key) ) end + it 'does not leave orphaned punctuation characters' do + patterns = PUNCTUATION_PAIRS.flat_map do |opening_punctuation, closing_punctuation| + [ + /#{Regexp.escape(opening_punctuation)}\s+/, + /\s+#{Regexp.escape(closing_punctuation)}/, + ] + end + pattern = Regexp.union(patterns) + + orphaned_whitespace = [] + i18n.locales.each do |locale| + i18n.data[locale].key_values.each do |key, value| + Array(value).each do |value| + next if !pattern.match?(value) + orphaned_whitespace.push("#{[locale, key].join('.')}: #{value}") + end + end + end + + expect(orphaned_whitespace).to( + be_empty, + <<~STR, + Unexpected orphaned punctuation. Ensure that you use non-breaking whitespace within punctuation characters (` ` unicode character or ` ` HTML entity). + + #{orphaned_whitespace.join("\n")}" + STR + ) + end + it 'does not have missing keys' do expect(missing_keys).to( be_empty,