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
2 changes: 1 addition & 1 deletion app/controllers/idv/link_sent_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def handle_document_verification_success
def render_document_capture_cancelled
redirect_to idv_hybrid_handoff_url
idv_session.flow_path = nil
failure(I18n.t('errors.doc_auth.document_capture_cancelled'))
failure(I18n.t('errors.doc_auth.document_capture_canceled'))
end

def render_step_incomplete_error
Expand Down
4 changes: 2 additions & 2 deletions app/views/account_reset/pending/cancel.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% self.title = t('account_reset.pending.cancelled') %>
<% self.title = t('account_reset.pending.canceled') %>

<%= render PageHeadingComponent.new.with_content(t('account_reset.pending.cancelled')) %>
<%= render PageHeadingComponent.new.with_content(t('account_reset.pending.canceled')) %>

<%= link_to(
t('links.continue_sign_in'),
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/cancellations/destroy.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% self.title = t('titles.idv.cancelled') %>
<% self.title = t('titles.idv.canceled') %>

<%= render StatusPageComponent.new(status: :error) do |c| %>
<% c.with_header { t('idv.cancel.headings.confirmation.hybrid') } %>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/account_reset/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ en:
title: Deleting your account should be your last resort
pending:
cancel_request: Cancel request
cancelled: We have cancelled your request to delete your account.
canceled: We have canceled your request to delete your account.
confirm: If you cancel now, you must create a new request and wait another
%{interval} to delete your account.
header: You requested to delete your account
Expand Down
2 changes: 1 addition & 1 deletion config/locales/account_reset/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ es:
title: Eliminar tu cuenta debería ser tu último recurso
pending:
cancel_request: Cancelar petición
cancelled: Hemos cancelado su solicitud para eliminar su cuenta.
canceled: Hemos cancelado su solicitud para eliminar su cuenta.
confirm: Si cancela ahora, debe crear una nueva solicitud y esperar otras
%{interval} para eliminar su cuenta.
header: Solicitaste eliminar tu cuenta
Expand Down
2 changes: 1 addition & 1 deletion config/locales/account_reset/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fr:
title: La suppression de votre compte devrait être votre dernier recours
pending:
cancel_request: Demande d’annulation
cancelled: Nous avons annulé votre demande de suppression de votre compte.
canceled: Nous avons annulé votre demande de suppression de votre compte.
confirm: Si vous annulez maintenant, vous devez créer une nouvelle demande et
attendre encore %{interval} pour supprimer votre compte.
header: Vous avez demandé de supprimer votre compte
Expand Down
2 changes: 1 addition & 1 deletion config/locales/errors/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ en:
consent_form: Before you can continue, you must give us permission. Please check
the box below and then click continue.
doc_type_not_supported_heading: We only accept a driver’s license or a state ID
document_capture_cancelled: You have cancelled uploading photos of your ID on your phone.
document_capture_canceled: You have canceled uploading photos of your ID on your phone.
how_to_verify_form: Select a way to verify your identity.
phone_step_incomplete: You must go to your phone and upload photos of your ID
before continuing. We sent you a link with instructions.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/errors/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ es:
continuación y luego haga clic en continuar.
doc_type_not_supported_heading: Solo aceptamos una licencia de conducir o un
documento de identidad estatal
document_capture_cancelled: Ha cancelado la carga de fotos de su identificación en este teléfono.
document_capture_canceled: Ha cancelado la carga de fotos de su identificación en este teléfono.
how_to_verify_form: Seleccione una forma de verificar su identidad.
phone_step_incomplete: Debe ir a su teléfono y cargar fotos de su identificación
antes de continuar. Te enviamos un enlace con instrucciones.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/errors/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fr:
Veuillez cocher la case ci-dessous puis cliquez sur continuer.
doc_type_not_supported_heading: Nous n’acceptons que les permis de conduire ou
les cartes d’identité délivrées par l’État
document_capture_cancelled: Vous avez annulé le téléchargement de vos photos
document_capture_canceled: Vous avez annulé le téléchargement de vos photos
d’identité sur votre téléphone.
how_to_verify_form: Sélectionnez un moyen de vérifier votre identité.
phone_step_incomplete: Vous devez aller sur votre téléphone et télécharger des
Expand Down
2 changes: 1 addition & 1 deletion config/locales/idv/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ en:
start_over: If you start over, you will restart this process from the beginning.
headings:
confirmation:
hybrid: You have cancelled uploading photos of your ID on this phone
hybrid: You have canceled uploading photos of your ID on this phone
exit:
with_sp: Exit %{app_name} and return to %{sp_name}
without_sp: Exit identity verification and go to your account page
Expand Down
2 changes: 1 addition & 1 deletion config/locales/telephony/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
en:
telephony:
account_deleted_notice: This text message confirms you have deleted your %{app_name} account.
account_reset_cancellation_notice: Your request to delete your %{app_name} account has been cancelled.
account_reset_cancellation_notice: Your request to delete your %{app_name} account has been canceled.
account_reset_notice: As requested, your %{app_name} account will be deleted in
%{interval}. Don't want to delete your account? Sign in to your
%{app_name} account to cancel.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/titles/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ en:
phone_verification: Phone number not verified
forget_all_browsers: Forget all browsers
idv:
canceled: Identity verification is canceled
cancellation_prompt: Cancel identity verification
cancelled: Identity verification is cancelled
come_back_soon: Come back soon
enter_one_time_code: Enter your one-time code
enter_password: Re-enter your password
Expand Down
2 changes: 1 addition & 1 deletion config/locales/titles/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ es:
phone_verification: Número telefónico no verificado
forget_all_browsers: Olvídate de todos los navegadores
idv:
canceled: Se canceló la verificación de identidad
cancellation_prompt: Cancela la verificación de identidad
cancelled: Se canceló la verificación de identidad
come_back_soon: Vuelve pronto
enter_one_time_code: Introduzca su código único
enter_password: Vuelve a ingresar tu contraseña
Expand Down
2 changes: 1 addition & 1 deletion config/locales/titles/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fr:
phone_verification: Numéro de téléphone non vérifié
forget_all_browsers: Oubliez tous les navigateurs
idv:
canceled: La vérification d’identité est annulée
cancellation_prompt: Annulez la vérification d’identité
cancelled: La vérification d’identité est annulée
come_back_soon: Revenez bientôt
enter_one_time_code: Entrez votre code à usage unique
enter_password: Saisissez à nouveau votre mot de passe
Expand Down
2 changes: 1 addition & 1 deletion config/locales/two_factor_authentication/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ en:
%{interval} from the time you made the request to complete the process.
Please check back later.
successful_cancel: Thank you. Your request to delete your %{app_name} account
has been cancelled.
has been canceled.
text_html: If you can’t use any of the authentication methods above, you can
reset your preferences by %{link_html}.
attempt_remaining_warning_html:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/user_mailer/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ en:
agency whose service you are trying to access.
subject: We couldn’t verify your identity
account_reset_cancel:
intro_html: This email confirms you have cancelled your request to delete your
intro_html: This email confirms you have canceled your request to delete your
%{app_name_html} account.
subject: Request canceled
account_reset_complete:
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/link_sent_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@

context 'document capture session canceled' do
let(:session_canceled_at) { Time.zone.now }
let(:error_message) { t('errors.doc_auth.document_capture_cancelled') }
let(:error_message) { t('errors.doc_auth.document_capture_canceled') }

before do
expect(FormResponse).to receive(:new).with(
Expand Down
2 changes: 1 addition & 1 deletion spec/features/account_reset/pending_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

click_on t('account_reset.pending.cancel_request')
click_on t('forms.buttons.continue')
expect(page).to have_content(t('account_reset.pending.cancelled'))
expect(page).to have_content(t('account_reset.pending.canceled'))

click_on t('links.continue_sign_in')
expect(page).to have_content(t('two_factor_authentication.header_text'))
Expand Down
16 changes: 15 additions & 1 deletion spec/i18n_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
es: /¿|ó/,
}.freeze

# Regex patterns for commonly misspelled words by locale. Match on word boundaries ignoring case.
# The current design should be adequate for a small number of words in each language.
# If we encounter false positives we should come up with a scheme to ignore those cases.
# Add additional words using the regex union operator '|'.
COMMONLY_MISSPELLED_WORDS = {
en: /\b(cancelled|occured|seperated?)\b/i,
}.freeze

module I18n
module Tasks
class BaseTask
Expand Down Expand Up @@ -162,6 +170,7 @@ def allowed_untranslated_key?(locale, key)

Dir["#{group_path}/*.yml"].each do |full_path|
i18n_file = full_path.sub("#{root_dir}/", '')
locale = File.basename(full_path, '.yml').to_sym

describe i18n_file do
let(:flattened_yaml_data) { flatten_hash(YAML.load_file(full_path)) }
Expand Down Expand Up @@ -206,13 +215,18 @@ def allowed_untranslated_key?(locale, key)

it 'does not contain content from another language' do
flattened_yaml_data.each do |key, value|
locale = key.split('.', 2).first.to_sym
other_locales = LOCALE_SPECIFIC_CONTENT.keys - [locale]
expect(value).not_to match(
Regexp.union(*LOCALE_SPECIFIC_CONTENT.slice(*other_locales).values),
)
end
end

it 'does not contain common misspellings', if: COMMONLY_MISSPELLED_WORDS.key?(locale) do
flattened_yaml_data.each do |key, value|
expect(value).not_to match(COMMONLY_MISSPELLED_WORDS[locale])
end
end
end
end
end
Expand Down