Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internalize and localize #18

Merged
merged 4 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion app/views/cbv_flows/_employer.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<%= turbo_frame_tag 'employers' do %>
<% if @employers.present? %>
<h3 class="site-preview-heading margin-bottom-2">
<%= t('cbv.employer_search.results') %>
</h3>
<% end %>
<div class="usa-card-group">
<% @employers.each do |employer| %>
<div class="usa-card usa-card--flag usa-card--media-right flex-1">
Expand All @@ -21,7 +26,7 @@
class="usa-button usa-button--outline"
type="button"
>
Select
<%= t('cbv.employer_search.select') %>
</button>
</div>
</div>
Expand Down
15 changes: 9 additions & 6 deletions app/views/cbv_flows/employer_search.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
<%= tag :meta, name: :argyle_sandbox, content: ENV['ARGYLE_SANDBOX'] %>
<% end %>

<h2>Get payment info from your employer.</h2>
<h2>
<%= t('cbv.employer_search.header') %>
</h2>

<div data-controller="cbv-flows">
<h3 class="site-preview-heading">Search for an employer</h3>
<h3 class="site-preview-heading">
<%= t('cbv.employer_search.subheader') %>
</h3>
<%= form_with url: cbv_flow_employer_search_path, method: :get, class: 'usa-search usa-search--big', html: { role: 'search' }, data: { turbo_frame: 'employers', turbo_action: 'advance' } do |f| %>
<%= f.label :query, "Search for your employer", class: "usa-sr-only" %>
<%= f.text_field :query, value: @query, class: "usa-input", type: 'search', data: { "cbv-flows-target": "searchTerms" } %>
Expand All @@ -15,13 +19,12 @@
type="submit"
>
<span class="usa-search__submit-text">
Search
<%= t('cbv.employer_search.search') %>
</span>
<%= image_tag "@uswds/uswds/dist/img/usa-icons-bg/search--white.svg", class: "usa-search__submit-icon", alt: "Search" %>
</button>
<% end %>

<h3 class="site-preview-heading margin-bottom-2">Results</h3>
<%= render partial: 'employer', locals: { employer: @employers } %>

<%= form_with url: next_path, method: :post, class: 'display-none', data: { 'cbv-flows-target': "form" } do |f| %>
Expand All @@ -46,11 +49,11 @@
<div class="usa-modal__content">
<div class="usa-modal__main">
<h2 class="usa-modal__heading" id="modal-3-heading">
We are fetching your employer's payment information.
<%= t('cbv.employer_search.fetching_payroll') %>
</h2>
<div class="usa-prose">
<p id="modal-3-description">
This may take a few minutes. Please do not close this window.
<%= t('cbv.employer_search.fetching_payroll_description') %>
</p>
</div>
<div class="lds-ripple" style="left: 30%;"><div></div><div></div></div>
Expand Down
13 changes: 7 additions & 6 deletions app/views/cbv_flows/entry.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<h1>Hello</h1>
<h2>Let's verify your payment information.</h2>
<h1><%= t('cbv.entry.header') %></h1>

<p>We'll connect to your payment records to get proof of payments to your caseworker and get benefits faster.</p>
<p><%= t('cbv.entry.subheader') %></p>

<p>Case Number: <strong><%= @cbv_flow.case_number %></strong></p>
<p><%= t('cbv.entry.case_number') %>: <strong><%= @cbv_flow.case_number %></strong></p>

<div class="usa-alert usa-alert--info margin-bottom-3">
<div class="usa-alert__body">
<p class="usa-alert__text">
Your information is secure. We will not share or keep your log in information. You will be able to preview and approve everything that is shared with your caseworker.
<%= t('cbv.entry.security_message') %>
</p>
</div>
</div>

<%= link_to next_path do %>
<button class="usa-button usa-button--outline" type="button">Get Started</button>
<button class="usa-button usa-button--outline" type="button">
<%= t('cbv.entry.get_started') %>
</button>
<% end %>
30 changes: 21 additions & 9 deletions app/views/cbv_flows/summary.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<h2>Review payment information from your employer</h2>
<h2>
<%= t('cbv.summary.header') %>
</h2>

<% if @payments.any? %>
<p>Below is payment information from your employer for the past 90 days.</p>
<h3 class="site-preview-heading">Total Payments: <%= number_to_currency(@payments.reduce(0) { |sum, payment| sum + payment[:amount] }) %></h3>
<p>
<%= t('cbv.summary.description') %>
</p>
<h3 class="site-preview-heading"><%= t('cbv.summary.total_payments') %> <%= number_to_currency(@payments.reduce(0) { |sum, payment| sum + payment[:amount] }) %></h3>

<div class="usa-accordion usa-accordion--multiselectable margin-bottom-4" data-allow-multiple>
<% @payments.each_with_index do |payment, index| %>
Expand All @@ -13,21 +17,29 @@
aria-expanded="false"
aria-controls="<%= index %>"
>
<%= payment[:employer] %>: Payment of <%= number_to_currency(payment[:amount]) %>
<%= payment[:employer] %>: <%= t('cbv.summary.payment_of', amount: number_to_currency(payment[:amount])) %>
</button>
</div>
<div id="<%= index %>" class="usa-accordion__content usa-prose">
<p>
<%= payment[:hours] %> hours from <%= format_date(payment[:start]) %> to <%= format_date(payment[:end]) %>
<%= t('cbv.summary.time_range', hours: payment[:hours], start: format_date(payment[:start]), end: format_date(payment[:end])) %>
</p>
</div>
<% end %>
</div>
<% else %>
<h3 class="site-preview-heading">No payments found. Please refresh the page after a few minutes.</h3>
<h3 class="site-preview-heading">
<%= t('cbv.summary.none_found') %>
</h3>
<% end %>

<h2>How would you like to share this information?</h2>
<h2>
<%= t('cbv.summary.subheader') %>
</h2>

<button class="usa-button" type="button">Share with Case Worker</button>
<button class="usa-button margin-top-3 usa-button--outline" type="button">Download PDF</button>
<button class="usa-button" type="button">
<%= t('cbv.summary.share_with_caseworker') %>
</button>
<button class="usa-button margin-top-3 usa-button--outline" type="button">
<%= t('cbv.summary.download_pdf') %>
</button>
8 changes: 4 additions & 4 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1>Welcome to Verify.gov</h1>
<h2>This website can help you get approved for your benefits.</h2>
<h1><%= t('shared.verify.welcome') %></h1>
<h2><%= t('shared.verify.description') %></h2>

<p>Get started here by requesting a link from your caseworker.</p>
<p><%= t('shared.verify.subheader') %></p>

<%= link_to cbv_flow_entry_path do %>
<button class="usa-button usa-button--outline" type="button">Start Flow Manually</button>
<button class="usa-button usa-button--outline" type="button"><%= t('cbv.manual_flow_start') %></button>
<% end %>
31 changes: 31 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,34 @@ en:
fr: Français
zh: 中文
skip_link: Skip to main content
verify:
welcome: Welcome to Verify.gov
description: This website can help you get approved for your benefits.
subheader: Get started here by requesting a link from your caseworker.
cbv:
Copy link
Contributor

Choose a reason for hiding this comment

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

let's align these with the name of the controller, i.e. cbv_flows rather than cbv.

That will allow us to do, in the controller, relative keys as described here: https://edgeguides.rubyonrails.org/i18n.html#lazy-lookup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Love it

hello: Hello
manual_flow_start: Start Flow Manually
entry:
header: Let's verify your payment information
subheader: We'll connect to your payment records to get proof of payments to your caseworker and get benefits faster.
case_number: Case Number
security_message: Your information is secure. We will not share or keep your log in information. You will be able to preview and approve everything that is shared with your caseworker.
get_started: Get Started
employer_search:
header: Get payment info from your employer.
subheader: Search for an employer
search: Search
results: Results
select: Select
fetching_payroll: We are fetching your employer's payment information.
fetching_payroll_description: This may take a few minutes. Please do not close this window.
summary:
header: Review payment information from your employer
description: Below is payment information from your employer for the past 90 days.
total_payments: Total Payments
payment_of: "Payment of %{amount}"
time_range: "%{hours} hours from %{start} to %{end}"
none_found: No payments found. Please refresh the page after a few minutes.
subheader: How would you like to share this information?
share_with_caseworker: Share with Case Worker
download_pdf: Download PDF
Loading