diff --git a/config/locales/en.yml b/config/locales/en.yml index 7ebcb6587cd..0baffbfb187 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -933,9 +933,9 @@ help_text.requested_attributes.full_name: Full name help_text.requested_attributes.ial1_consent_reminder_html: You must consent each year to share your information with %{sp}. We’ll share your information with %{sp} to connect your account. help_text.requested_attributes.ial1_intro_html: We’ll share your information with %{sp} to connect your account. help_text.requested_attributes.ial2_consent_reminder_html: "%{sp} needs to know who you are to connect to your account. You must consent each year to share your verified information with %{sp}. We’ll share this information: " -help_text.requested_attributes.ial2_intro_html: '%{sp} needs to know who you are to connect your account. We’ll share this information with %{sp}: ' -help_text.requested_attributes.ial2_reverified_consent_info: 'Because you verified your identity again, we need your permission to share this information with %{sp}: ' + ng> needs to know who you are to connect to your account. You must consent each year to share your verified information with %{sp}. We’ll share this information:" +help_text.requested_attributes.ial2_intro_html: '%{sp} needs to know who you are to connect your account. We’ll share this information with %{sp}:' +help_text.requested_attributes.ial2_reverified_consent_info: 'Because you verified your identity again, we need your permission to share this information with %{sp}:' help_text.requested_attributes.phone: Phone number help_text.requested_attributes.social_security_number: Social Security number help_text.requested_attributes.verified_at: Updated on @@ -1133,9 +1133,7 @@ idv.warning.attempts_html.one: For security reasons, you have one attemp idv.warning.attempts_html.other: For security reasons, you have %{count} attempts remaining. idv.warning.sessions.heading: We couldn’t find records matching your personal information idv.warning.state_id.cancel_button: Exit %{app_name} -idv.warning.state_id.explanation: | - Unfortunately, we’re experiencing technical difficulties - with IDs from your state and are currently unable to verify your information. +idv.warning.state_id.explanation: Unfortunately, we’re experiencing technical difficulties with IDs from your state and are currently unable to verify your information. idv.warning.state_id.heading: We are working to resolve an error idv.warning.state_id.next_steps.items_html: - Try again now or @@ -1309,7 +1307,7 @@ instructions.password.strength.1: Weak instructions.password.strength.2: Average instructions.password.strength.3: Good instructions.password.strength.4: Great -instructions.password.strength.intro: 'Password strength: ' +instructions.password.strength.intro: 'Password strength:' instructions.sp_handoff_bounced: Your sign in was successful, but %{sp_name} sent you back to %{app_name}. Please contact %{sp_link} for help. instructions.sp_handoff_bounced_with_no_sp: your service provider links.account.reactivate.with_key: I have my key diff --git a/config/locales/es.yml b/config/locales/es.yml index 48b33ece569..6afdea499e4 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -932,9 +932,9 @@ help_text.requested_attributes.email: Dirección de correo electrónico help_text.requested_attributes.full_name: Nombre completo help_text.requested_attributes.ial1_consent_reminder_html: Debe dar su consentimiento cada año para divulgar su información a %{sp}. Divulgaremos su información a %{sp} para conectar su cuenta. help_text.requested_attributes.ial1_intro_html: Divulgaremos su información a %{sp} para conectar su cuenta. -help_text.requested_attributes.ial2_consent_reminder_html: 'Para conectar su cuenta, %{sp} necesita saber quién es usted. Debe dar su consentimiento cada año para divulgar su información verificada a %{sp}. Divulgaremos esta información: ' -help_text.requested_attributes.ial2_intro_html: 'Para conectar su cuenta, %{sp} necesita saber quién es usted. Divulgaremos esta información a %{sp}: ' -help_text.requested_attributes.ial2_reverified_consent_info: 'Como volvió a verificar su identidad, necesitamos su permiso para divulgar esta información a %{sp}: ' +help_text.requested_attributes.ial2_consent_reminder_html: 'Para conectar su cuenta, %{sp} necesita saber quién es usted. Debe dar su consentimiento cada año para divulgar su información verificada a %{sp}. Divulgaremos esta información:' +help_text.requested_attributes.ial2_intro_html: 'Para conectar su cuenta, %{sp} necesita saber quién es usted. Divulgaremos esta información a %{sp}:' +help_text.requested_attributes.ial2_reverified_consent_info: 'Como volvió a verificar su identidad, necesitamos su permiso para divulgar esta información a %{sp}:' help_text.requested_attributes.phone: Número de teléfono help_text.requested_attributes.social_security_number: Número de Seguro Social help_text.requested_attributes.verified_at: Actualizado en @@ -1306,7 +1306,7 @@ instructions.password.strength.1: Débil instructions.password.strength.2: Promedio instructions.password.strength.3: Buena instructions.password.strength.4: Muy buena -instructions.password.strength.intro: 'Seguridad de la contraseña: ' +instructions.password.strength.intro: 'Seguridad de la contraseña:' instructions.sp_handoff_bounced: Logró iniciar sesión, pero %{sp_name} lo envió de nuevo a %{app_name}. Contacte con %{sp_link} para obtener ayuda. instructions.sp_handoff_bounced_with_no_sp: su proveedor de servicios links.account.reactivate.with_key: Tengo mi clave diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 387559eafd1..e4c37dc3c17 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1133,10 +1133,7 @@ idv.warning.attempts_html.one: Pour des raisons de sécurité, il vous reste %{count} tentatives. idv.warning.sessions.heading: Nous n’avons pas trouvé de dossiers correspondant à vos informations personnelles idv.warning.state_id.cancel_button: Quitter %{app_name} -idv.warning.state_id.explanation: - 'Malheureusement, nous rencontrons des difficultés techniques avec les pièces d’identité de votre État et ne sommes pas en mesure de vérifier vos informations pour le moment. - - ' +idv.warning.state_id.explanation: Malheureusement, nous rencontrons des difficultés techniques avec les pièces d’identité de votre État et ne sommes pas en mesure de vérifier vos informations pour le moment. idv.warning.state_id.heading: Nous travaillons à la résolution d’une erreur idv.warning.state_id.next_steps.items_html: - Réessayer maintenant ou @@ -1310,7 +1307,7 @@ instructions.password.strength.1: Faible instructions.password.strength.2: Moyen instructions.password.strength.3: Bonne instructions.password.strength.4: Excellente -instructions.password.strength.intro: 'Force du mot de passe : ' +instructions.password.strength.intro: 'Force du mot de passe :' instructions.sp_handoff_bounced: Votre connexion a réussi, mais %{sp_name} vous a renvoyé à %{app_name}. Veuillez contacter %{sp_link} pour obtenir de l’aide. instructions.sp_handoff_bounced_with_no_sp: votre fournisseur de service links.account.reactivate.with_key: J’ai ma clé diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 2ae822109ee..bc4ccf0873e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -937,10 +937,9 @@ help_text.requested_attributes.full_name: 姓名 help_text.requested_attributes.ial1_consent_reminder_html: 你每年都必须授权同意与 %{sp} 分享信息。我们将与 %{sp} 分享你的信息来连接你账户。 help_text.requested_attributes.ial1_intro_html: 我们将与 %{sp} 分享你的信息来连接你账户。 help_text.requested_attributes.ial2_consent_reminder_html: "%{sp} 需要知道你是谁才能连接你的账户。你每年都必须授权同意与 %{sp} 分享已验证过的你的信息。我们会分享这些信息: - " -help_text.requested_attributes.ial2_intro_html: '%{sp} 需要知道你是谁才能连接你的账户。我们会与 %{sp} 分享这些信息: ' -help_text.requested_attributes.ial2_reverified_consent_info: '因为你重新验证了身份,我们需要得到你的许可才能与 %{sp} 分享该信息。 ' + ng> 需要知道你是谁才能连接你的账户。你每年都必须授权同意与 %{sp} 分享已验证过的你的信息。我们会分享这些信息:" +help_text.requested_attributes.ial2_intro_html: '%{sp} 需要知道你是谁才能连接你的账户。我们会与 %{sp} 分享这些信息:' +help_text.requested_attributes.ial2_reverified_consent_info: '因为你重新验证了身份,我们需要得到你的许可才能与 %{sp} 分享该信息。' help_text.requested_attributes.phone: 电话号码 help_text.requested_attributes.social_security_number: 社会保障号码 help_text.requested_attributes.verified_at: 更新是在 @@ -1096,7 +1095,7 @@ idv.messages.gpo.start_over_html: 如果该地址不对,你需要%{start_over_ idv.messages.gpo.start_over_link_text: 重新开始并用你新地址进行验证。 idv.messages.gpo.timeframe_html: 你会在 5 到 10 天 里收到带有验证码 的信。 idv.messages.otp_delivery_method_description: 如果你在上面输入的是座机电话,请在下边选择“接听电话”。 -idv.messages.phone.alert_html: '输入一个这样的电话号码: ' +idv.messages.phone.alert_html: '输入一个这样的电话号码:' idv.messages.phone.description: 我们会将该号码与记录核对并给你发个一次性代码。这是为了帮助你验证身份。 idv.messages.phone.failed_number.alert_text: 我们无法将你与该号码匹配。 idv.messages.phone.failed_number.gpo_alert_html: 试试 另一个 号码或者%{link_html}。 @@ -1313,7 +1312,7 @@ instructions.password.strength.1: 弱 instructions.password.strength.2: 一般 instructions.password.strength.3: 好 instructions.password.strength.4: 棒! -instructions.password.strength.intro: '密码强度: ' +instructions.password.strength.intro: '密码强度:' instructions.sp_handoff_bounced: 你登录成功了,但 %{sp_name} 将你送回到 %{app_name}。请联系 %{sp_link} 寻求帮助。 instructions.sp_handoff_bounced_with_no_sp: 你的服务提供商 links.account.reactivate.with_key: 我有密钥 diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb index 22b618c8959..19683eceff5 100644 --- a/spec/i18n_spec.rb +++ b/spec/i18n_spec.rb @@ -8,6 +8,12 @@ 'time.formats.event_timestamp_js', ].sort.freeze +ALLOWED_LEADING_OR_TRAILING_SPACE_KEYS = [ + 'datetime.dotiw.last_word_connector', + 'datetime.dotiw.two_words_connector', + 'datetime.dotiw.words_connector', +].sort.freeze + # These are keys with mismatch interpolation for specific locales ALLOWED_INTERPOLATION_MISMATCH_LOCALE_KEYS = [ # need to be fixed @@ -226,6 +232,32 @@ class BaseTask ].freeze # rubocop:enable Layout/LineLength + def leading_or_trailing_whitespace_keys + self.locales.each_with_object([]) do |locale, result| + data[locale].key_values.each_with_object(result) do |key_value, result| + key, value = key_value + next if ALLOWED_LEADING_OR_TRAILING_SPACE_KEYS.include?(key) + + leading_or_trailing_whitespace = + if value.is_a?(String) + leading_or_trailing_whitespace?(value) + elsif value.is_a?(Array) + value.compact.any? { |x| leading_or_trailing_whitespace?(x) } + end + + if leading_or_trailing_whitespace + result << "#{locale}.#{key}" + end + + result + end + end + end + + def leading_or_trailing_whitespace?(value) + value.match?(/\A\s|\s\z/) + end + def untranslated_keys data[base_locale].key_values.each_with_object([]) do |key_value, result| key, value = key_value @@ -267,6 +299,9 @@ def allowed_untranslated_key?(locale, key) let(:missing_keys) { i18n.missing_keys } let(:unused_keys) { i18n.unused_keys } let(:untranslated_keys) { i18n.untranslated_keys } + let(:leading_or_trailing_whitespace_keys) do + i18n.leading_or_trailing_whitespace_keys + end it 'does not have missing keys' do expect(missing_keys).to( @@ -275,6 +310,13 @@ def allowed_untranslated_key?(locale, key) ) end + it 'does not have leading or trailing whitespace' do + expect(leading_or_trailing_whitespace_keys).to( + be_empty, + "keys with leading or trailing whitespace: #{leading_or_trailing_whitespace_keys}", + ) + end + it 'does not have unused keys' do expect(unused_keys).to( be_empty,