Skip to content

Commit

Permalink
737-i18n-to-all-views (#836)
Browse files Browse the repository at this point in the history
* Add landing page view translations and I18n:
views->root->index

* Add layouts shared views translations

* Add more readable translation name
  • Loading branch information
wandergithub authored Jun 19, 2024
1 parent 11f8bfb commit a790109
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 50 deletions.
16 changes: 8 additions & 8 deletions app/views/layouts/shared/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<div class="col-lg-4 col-md-6 col-12">
<!-- about company -->
<div class="mb-4">
<h3> Pet Rescue </h3>
<h3> <%= t('.title') %> </h3>
<div class="mt-4">
<p>
If you are a pet adoption or foster organization and want a website like this one, for free,
<%= link_to 'Click Here', root_path %>
<%= t('.call') %>
<%= link_to t('.action'), root_path %>

</p>
</div>
Expand All @@ -18,7 +18,7 @@
<div class="offset-lg-1 col-lg-2 col-md-3 col-6">
<div class="mb-4">
<!-- list -->
<h3 class="fw-bold mb-3">Company</h3>
<h3 class="fw-bold mb-3"><%= t('.company') %></h3>
<ul class="list-unstyled nav nav-footer flex-column nav-x-0">
<% if Current.tenant&.profile.facebook_url.present? || Current.tenant&.profile.instagram_url.present? %>
<li class="d-flex gap-3">
Expand Down Expand Up @@ -86,15 +86,15 @@
<span id="copyright">
<script>document.getElementById('copyright').appendChild(document.createTextNode(new Date().getFullYear()))</script>
</span>
Pet-Rescue, Inc. All Rights Reserved
<%= t('.rights') %>
</span>
</div>
<!-- Links -->
<div class="col-12 col-md-7 col-lg-8 d-md-flex justify-content-end">
<nav class="nav nav-footer">
<a class="nav-link ps-0" href="#">Privacy Policy</a>
<a class="nav-link px-2 px-md-3" href="#">Cookie Notice </a>
<a class="nav-link" href="#">Terms of Use</a>
<a class="nav-link ps-0" href="#"><%= t('.policy') %></a>
<a class="nav-link px-2 px-md-3" href="#"><%= t('.cookie') %></a>
<a class="nav-link" href="#"><%= t('.terms') %></a>
</nav>
</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions app/views/layouts/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
</div>

<% unless user_signed_in? %>
<%= active_link_to 'Sign Up', new_user_registration_path, class: 'btn btn-primary mx-2' %>
<%= active_link_to 'Log In', new_user_session_path, class: 'btn btn-primary' %>
<%= active_link_to t('.sign_up'), new_user_registration_path, class: 'btn btn-primary mx-2' %>
<%= active_link_to t('.log_in'), new_user_session_path, class: 'btn btn-primary' %>
<% end %>
<% if user_signed_in? %>
<li class="nav-item d-block">
<%= button_to 'Log Out', destroy_user_session_path, method: :delete, data: { turbo: false }, class: 'ms-2 btn btn-primary' %>
<%= button_to t('.log_out'), destroy_user_session_path, method: :delete, data: { turbo: false }, class: 'ms-2 btn btn-primary' %>
</li>
<% end %>
</div>
Expand All @@ -30,25 +30,25 @@
<div class="justify-content-end collapse navbar-collapse" id="navbar-default3">
<ul class="navbar-nav">
<li class='nav-item'>
<%= active_link_to 'Pets', adoptable_pets_path, class: 'nav-link' %>
<%= active_link_to t('.pets'), adoptable_pets_path, class: 'nav-link' %>
</li>
<li class='nav-item'>
<%= active_link_to 'Contact', new_contact_path, class: 'nav-link' %>
<%= active_link_to t('.contact'), new_contact_path, class: 'nav-link' %>
</li>
<li class="nav-item">
<%= active_link_to 'Donate', donate_path, class: 'nav-link' %>
<%= active_link_to t('.donate'), donate_path, class: 'nav-link' %>
</li>
<li class="nav-item">
<%= active_link_to 'FAQ', faq_index_path, class: 'nav-link' %>
<%= active_link_to t('.faq'), faq_index_path, class: 'nav-link' %>
</li>
<% if user_signed_in? %>
<% if allowed_to?(:index?, with: Organizations::AdopterFosterDashboardPolicy, context: {organization: Current.organization}) %> <li class='nav-item'>
<%= active_link_to 'Dashboard', adopter_fosterer_dashboard_index_path, class: 'nav-link' %>
<%= active_link_to t('.dashboard'), adopter_fosterer_dashboard_index_path, class: 'nav-link' %>
</li>
<% end %>
<% if allowed_to?(:index?, with: Organizations::DashboardPolicy, context: {organization: Current.organization}) %>
<li class='nav-item'>
<%= active_link_to 'Dashboard', staff_dashboard_index_path, class: 'nav-link' %>
<%= active_link_to t('.dashboard'), staff_dashboard_index_path, class: 'nav-link' %>
</li>
<% end %>
<% end %>
Expand All @@ -59,6 +59,6 @@
<!-- Demo banner-->
<% if Rails.env.staging? %>
<div class="container-fluid m-0 p-2 text-center bg-danger-soft display-6">
This is a demo site
<%= t('.demo') %>
</div>
<% end %>
18 changes: 9 additions & 9 deletions app/views/layouts/shared/_no_tenant_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<div class="col-lg-4 col-md-6 col-12">
<!-- about company -->
<div class="mb-4">
<h3> Pet Rescue </h3>
<h3><%= t('.title') %></h3>
<div class="mt-4">
<p> We provide a platform for Pet Rescues and Animal Service Organizations </p>
<p><%= t('.description') %></p>
<!-- social media -->
<div class="fs-4 mt-4">
<a href="#" class="mdi mdi-facebook fs-4 text-muted me-2"></a>
Expand All @@ -20,13 +20,13 @@
<div class="offset-lg-1 col-lg-2 col-md-3 col-6">
<div class="mb-4">
<!-- list -->
<h3 class="fw-bold mb-3">Company</h3>
<h3 class="fw-bold mb-3"><%= t('.company') %></h3>
<ul class="list-unstyled nav nav-footer flex-column nav-x-0">
<li>
<%= active_link_to 'About Us', about_us_path, class: 'nav-link' %>
<%= active_link_to t('.about'), about_us_path, class: 'nav-link' %>
</li>
<li>
<%= active_link_to 'Partners', partners_path, class: 'nav-link' %>
<%= active_link_to t('.partners'), partners_path, class: 'nav-link' %>
</li>
</ul>
</div>
Expand All @@ -40,15 +40,15 @@
<span id="copyright">
<script>document.getElementById('copyright').appendChild(document.createTextNode(new Date().getFullYear()))</script>
</span>
Pet-Rescue, Inc. All Rights Reserved
<%= t('.rights') %>
</span>
</div>
<!-- Links -->
<div class="col-12 col-md-7 col-lg-8 d-md-flex justify-content-end">
<nav class="nav nav-footer">
<a class="nav-link ps-0" href="#">Privacy Policy</a>
<a class="nav-link px-2 px-md-3" href="#">Cookie Notice </a>
<a class="nav-link" href="#">Terms of Use</a>
<a class="nav-link ps-0" href="#"><%= t('.policy') %></a>
<a class="nav-link px-2 px-md-3" href="#"><%= t('.cookie') %></a>
<a class="nav-link" href="#"><%= t('.terms') %></a>
</nav>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/shared/_no_tenant_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<nav class="navbar navbar-expand-lg navbar-transparent shadow-none px-2 py-3">
<div class="container px-0">
<%= link_to root_path, class: 'navbar-brand' do %>
Pet Rescue
<%= t('.title') %>
<% end %>
<div class="d-flex align-items-center order-lg-3">
<div>
Expand All @@ -23,7 +23,7 @@

<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark" href="#" id="navbarBrowse" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-bs-display="static">
Rescues
<%= t('.dropdown_title') %>
</a>
<ul class="dropdown-menu dropdown-menu-arrow" aria-labelledby="navbarBrowse">
<% Organization.all.each do |org| %>
Expand Down
42 changes: 21 additions & 21 deletions app/views/root/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
<div class="row d-flex align-items-center">
<div class="col-xxl-5 col-xl-6 col-lg-6 col-12">
<div>
<h1 class="display-2 fw-bold mb-3">Connecting hearts and homes <u class="text-warning"><span class="text-primary">worldwide</span></u></h1>
<p class="lead mb-4">A free application for pet foster and adoption organizations who want to save time and manage their operations in one place.</p>
<h1 class="display-2 fw-bold mb-3"><%= t('.title') + " " %><u class="text-warning"><span class="text-primary"><%= t('.worldwide') %></span></u></h1>
<p class="lead mb-4"><%= t('.description') %></p>
<ul class="list-unstyled mb-5">
<li class="mb-2">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="var(--geeks-success)" class="bi bi-check-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"></path>
</svg>
<span class="ms-2">Easy to use</span>
<span class="ms-2"><%= t('.easy_to_use') %></span>
</li>
<li class="mb-2">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="var(--geeks-success)" class="bi bi-check-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"></path>
</svg>
<span class="ms-2">No dowload needed</span>
<span class="ms-2"><%= t('.no_download') %></span>
</li>
<li class="mb-2">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="var(--geeks-success)" class="bi bi-check-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"></path>
</svg>
<span class="ms-2">Manage operations in one place</span>
<span class="ms-2"><%= t('.manage') %></span>
</li>
<li class="mb-2">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="var(--geeks-success)" class="bi bi-check-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"></path>
</svg>
<span class="ms-2">Save time and spend it on what matters</span>
<span class="ms-2"><%= t('.save') %></span>
</li>
</ul>
<a href="#!" class="btn btn-dark btn-lg mb-2">Request an account</a>
<a href="#!" class="btn btn-dark btn-lg mb-2"><%= t('.btn_title') %></a>
</div>
</div>
<div class="col-xxl-5 offset-xxl-1 col-xl-6 col-lg-6 col-12 d-lg-flex justify-content-end">
Expand All @@ -55,8 +55,8 @@
<div class="col-xl-6 offset-xl-3 col-md-12 col-12">
<div class="text-center mb-lg-10 mb-6">
<h2 class="h1 fw-bold">
Manage your operations<u class="text-warning"><span class="text-primary"> in one place</span></u></h2>
<p class="lead mb-4">No more spreadsheets, no more paper, no more headaches.</p>
<%= t('.subtitle') %><u class="text-warning"><span class="text-primary"> <%= t('.subtitle_highlight') %></span></u></h2>
<p class="lead mb-4"><%= t('.subtitle_description') %></p>
</div>
</div>
</div>
Expand All @@ -70,7 +70,7 @@
<span><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="var(--geeks-primary)" class="bi bi-patch-check-fill" viewBox="0 0 16 16">
<path d="M10.067.87a2.89 2.89 0 0 0-4.134 0l-.622.638-.89-.011a2.89 2.89 0 0 0-2.924 2.924l.01.89-.636.622a2.89 2.89 0 0 0 0 4.134l.637.622-.011.89a2.89 2.89 0 0 0 2.924 2.924l.89-.01.622.636a2.89 2.89 0 0 0 4.134 0l.622-.637.89.011a2.89 2.89 0 0 0 2.924-2.924l-.01-.89.636-.622a2.89 2.89 0 0 0 0-4.134l-.637-.622.011-.89a2.89 2.89 0 0 0-2.924-2.924l-.89.01-.622-.636zm.287 5.984-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7 8.793l2.646-2.647a.5.5 0 0 1 .708.708z"></path>
</svg>
</span><span class="ms-2 mb-4">Manage your operation with ease</span>
</span><span class="ms-2 mb-4"><%= t('.img_sub') %></span>
</div>
</div>
</div>
Expand All @@ -84,8 +84,8 @@
</svg>
</div>
<div>
<h4>Logistics</h4>
<p>Keep track of your animals in one place.</p>
<h4><%= t('.logistics') %></h4>
<p><%= t('.logistics_description') %></p>
</div>
</div>
</div>
Expand All @@ -97,8 +97,8 @@
</svg>
</div>
<div>
<h4>Free for ever!</h4>
<p>Our platform is free to use for all rescues, forever.</p>
<h4><%= t('.free') %></h4>
<p><%= t('.free_description') %></p>
</div>
</div>
</div>
Expand All @@ -111,8 +111,8 @@
</svg>
</div>
<div>
<h4>Manage applications</h4>
<p>Receive, review and process adoption and foster applications with ease.</p>
<h4><%= t('.manage') %></h4>
<p><%= t('.manage_description') %></p>
</div>
</div>
</div>
Expand All @@ -125,8 +125,8 @@
</svg>
</div>
<div>
<h4>Support</h4>
<p>Our team is here to help you with any questions you may have.</p>
<h4><%= t('.support') %></h4>
<p><%= t('.support_description') %></p>
</div>
</div>
</div>
Expand All @@ -144,9 +144,9 @@
<div class="row align-items-center">
<div class="offset-xl-1 col-xl-5 col-md-6 col-12">
<div>
<h2 class="h1 text-white mb-3">Header</h2>
<p class="text-white pb-2 fs-4">…an awesome sentence or two.</p>
<button class="btn btn-dark">Call to action</button>
<h2 class="h1 text-white mb-3"><%= t('.header') %></h2>
<p class="text-white pb-2 fs-4"><%= t('.call_to_action') %></p>
<button class="btn btn-dark"><%= t('.btn_call_to_action') %></button>
</div>
</div>
<div class="col-xl-6 col-md-6 col-12">
Expand Down
59 changes: 59 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,31 @@ en:
status: Status
withdraw_submission: Withdraw Application
confirm_withdraw: Withdraw your application
root:
index:
title: "Connecting hearts and homes"
worldwide: "worldwide"
description: "A free application for pet foster and adoption organizations who want to save time and manage their operations in one place."
easy_to_use: "Easy to use"
no_download: "No dowload needed"
manage: "Manage operations in one place"
save: "Save time and spend it on what matters"
btn_title: "Request an account"
subtitle: "Manage your operations"
subtitle_highlight: "in one place"
subtitle_description: "No more spreadsheets, no more paper, no more headaches."
img_sub: "Manage your operation with ease"
logistics: "Logistics"
logistics_description: "Keep track of your animals in one place."
free: "Free for ever!"
free_description: "Our platform is free to use for all rescues, forever."
manage: "Manage applications"
manage_description: "Receive, review and process adoption and foster applications with ease."
support: "Support"
support_description: "Our team is here to help you with any questions you may have."
header: "Header"
call_to_action: "…an awesome sentence or two."
btn_call_to_action: "Call to action"
views:
dashboard:
index:
Expand All @@ -86,6 +111,40 @@ en:
status: Status
withdraw_submission: Withdraw Application
confirm_withdraw: Withdraw your application
layouts:
shared:
footer:
title: "Pet Rescue"
call: "If you are a pet adoption or foster organization and want a website like this one, for free,"
action: "Click Here"
company: "Company"
rights: "Pet-Rescue, Inc. All Rights Reserved"
policy: "Privacy Policy"
cookie: "Cookie Notice"
terms: "Terms of Use"
navbar:
sign_up: "Sign Up"
log_in: "Log In"
log_out: "Log Out"
pets: "Pets"
contact: "Contact"
donate: "Donate"
faq: "FAQ"
dashboard: "Dashboard"
demo: "This is a demo site"
no_tenant_footer:
title: "Pet Rescue"
description: "We provide a platform for Pet Rescues and Animal Service Organizations"
company: "Company"
about: "About Us"
partners: "Partners"
rights: "Pet-Rescue, Inc. All Rights Reserved"
policy: "Privacy Policy"
cookie: "Cookie Notice"
terms: "Terms of Use"
no_tenant_navbar:
title: "Pet Rescue"
dropdown_title: "Rescues"
activerecord:
errors:
models:
Expand Down

0 comments on commit a790109

Please sign in to comment.