Skip to content

Add internationalization test against leading and trailing whitespace#10583

Merged
mitchellhenke merged 5 commits intomainfrom
mitchellhenke/consistent-whitespace-i18n
May 10, 2024
Merged

Add internationalization test against leading and trailing whitespace#10583
mitchellhenke merged 5 commits intomainfrom
mitchellhenke/consistent-whitespace-i18n

Conversation

@mitchellhenke
Copy link
Contributor

🛠 Summary of changes

With a few exceptions, we are rendering content in HTML where whitespace is not significant and won't be displayed. This PR adds a test to alert when we include such whitespace. Cases where we concatenate content like the following is a case where removal of whitespace would cause a change in the display, and will be validated prior to merging.

"#{t('content1')}#{t('content2')}"

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Validate that the content changed does not join content to make the whitespace significant

Mitchell Henke added 5 commits May 9, 2024 14:29
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines 935 to +938
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}:'
Copy link
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.

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
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.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
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.

instructions.password.strength.3: Good
instructions.password.strength.4: Great
instructions.password.strength.intro: 'Password strength: '
instructions.password.strength.intro: 'Password strength:'
Copy link
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') %>

@mitchellhenke mitchellhenke merged commit a9e312e into main May 10, 2024
@mitchellhenke mitchellhenke deleted the mitchellhenke/consistent-whitespace-i18n branch May 10, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants