Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <strong>%{sp}</strong>. We’ll share your information with <strong>%{sp}</strong> to connect your account.
help_text.requested_attributes.ial1_intro_html: We’ll share your information with <strong>%{sp}</strong> to connect your account.
help_text.requested_attributes.ial2_consent_reminder_html: "<strong>%{sp}</stro\
ng> needs to know who you are to connect to your account. You must consent each year to share your verified information with <strong>%{sp}</strong>. We’ll share this information: "
help_text.requested_attributes.ial2_intro_html: '<strong>%{sp}</strong> 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 <strong>%{sp}</strong>. We’ll share this information:"
help_text.requested_attributes.ial2_intro_html: '<strong>%{sp}</strong> 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}:'
Comment on lines 935 to +938
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

help_text.requested_attributes.ial2_consent_reminder_html
help_text.requested_attributes.ial2_intro_html
help_text.requested_attributes.ial2_reverified_consent_info

are all used here

for
<%= @presenter.intro.html_safe %>
so the space removal should be safe.

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
Expand Down Expand Up @@ -1133,9 +1133,7 @@ idv.warning.attempts_html.one: For security reasons, you have <strong>one attemp
idv.warning.attempts_html.other: For security reasons, you have <strong>%{count} attempts</strong> 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: |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p><%= t('idv.warning.state_id.explanation') %></p>
is the only usage of this content that I can fine, so it should be safe to remove the whitespace here.

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 <strong>or</strong>
Expand Down Expand Up @@ -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:'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Difference between deployed environment with existing space and testing locally with the space shows no difference in the rendered content for

<%= t('instructions.password.strength.intro') %>

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
Expand Down
8 changes: 4 additions & 4 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <strong>%{sp}</strong>. Divulgaremos su información a <strong>%{sp}</strong> para conectar su cuenta.
help_text.requested_attributes.ial1_intro_html: Divulgaremos su información a <strong>%{sp}</strong> para conectar su cuenta.
help_text.requested_attributes.ial2_consent_reminder_html: 'Para conectar su cuenta, <strong>%{sp}</strong> necesita saber quién es usted. Debe dar su consentimiento cada año para divulgar su información verificada a <strong>%{sp}</strong>. Divulgaremos esta información: '
help_text.requested_attributes.ial2_intro_html: 'Para conectar su cuenta, <strong>%{sp}</strong> 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, <strong>%{sp}</strong> necesita saber quién es usted. Debe dar su consentimiento cada año para divulgar su información verificada a <strong>%{sp}</strong>. Divulgaremos esta información:'
help_text.requested_attributes.ial2_intro_html: 'Para conectar su cuenta, <strong>%{sp}</strong> 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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1133,10 +1133,7 @@ idv.warning.attempts_html.one: Pour des raisons de sécurité, il vous reste <st
idv.warning.attempts_html.other: Pour des raisons de sécurité, il vous reste <strong>%{count} tentatives</strong>.
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 <strong>ou</strong>
Expand Down Expand Up @@ -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é
Expand Down
11 changes: 5 additions & 6 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -937,10 +937,9 @@ help_text.requested_attributes.full_name: 姓名
help_text.requested_attributes.ial1_consent_reminder_html: 你每年都必须授权同意与 <strong>%{sp}</strong> 分享信息。我们将与 <strong>%{sp}</strong> 分享你的信息来连接你账户。
help_text.requested_attributes.ial1_intro_html: 我们将与 <strong>%{sp}</strong> 分享你的信息来连接你账户。
help_text.requested_attributes.ial2_consent_reminder_html: "<strong>%{sp}</stro\
ng> 需要知道你是谁才能连接你的账户。你每年都必须授权同意与 <strong>%{sp}</strong> 分享已验证过的你的信息。我们会分享这些信息:
"
help_text.requested_attributes.ial2_intro_html: '<strong>%{sp}</strong> 需要知道你是谁才能连接你的账户。我们会与 %{sp} 分享这些信息: '
help_text.requested_attributes.ial2_reverified_consent_info: '因为你重新验证了身份,我们需要得到你的许可才能与 %{sp} 分享该信息。 '
ng> 需要知道你是谁才能连接你的账户。你每年都必须授权同意与 <strong>%{sp}</strong> 分享已验证过的你的信息。我们会分享这些信息:"
help_text.requested_attributes.ial2_intro_html: '<strong>%{sp}</strong> 需要知道你是谁才能连接你的账户。我们会与 %{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: 更新是在
Expand Down Expand Up @@ -1096,7 +1095,7 @@ idv.messages.gpo.start_over_html: 如果该地址不对,你需要%{start_over_
idv.messages.gpo.start_over_link_text: 重新开始并用你新地址进行验证。
idv.messages.gpo.timeframe_html: 你会在<strong> 5 到 10 天</strong> 里收到带有<strong>验证码</strong> 的信。
idv.messages.otp_delivery_method_description: 如果你在上面输入的是座机电话,请在下边选择“接听电话”。
idv.messages.phone.alert_html: '<strong>输入一个这样的电话号码:</strong> '
idv.messages.phone.alert_html: '<strong>输入一个这样的电话号码:</strong>'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an inconsistency compared to the other languages and seems to have been a mistake.

idv.messages.phone.description: 我们会将该号码与记录核对并给你发个一次性代码。这是为了帮助你验证身份。
idv.messages.phone.failed_number.alert_text: 我们无法将你与该号码匹配。
idv.messages.phone.failed_number.gpo_alert_html: 试试 <strong>另一个</strong> 号码或者%{link_html}。
Expand Down Expand Up @@ -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: 我有密钥
Expand Down
42 changes: 42 additions & 0 deletions spec/i18n_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down