Skip to content

Commit

Permalink
1025 make sure translations used in the adopter fosterer scope (rubyf…
Browse files Browse the repository at this point in the history
…orgood#1037)

* add tasks and files translation

* change header title with translated text in adopted pets page

* translate cards in the adopter fosterer dashboard

* change header title with translatable text on the likes page

* add adoption status translations on the Liked Pets page

* replace table headers of incomplete tasks table with i18n text
  • Loading branch information
wuletawwonte authored Oct 9, 2024
1 parent 380b703 commit 5694781
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<turbo-frame id="pet_files">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="pills-files-tab" data-bs-toggle="pill" data-bs-target="#pills-files" type="button" role="tab" aria-controls="pills-files" aria-selected="true">Files</button>
<button class="nav-link active" id="pills-files-tab" data-bs-toggle="pill" data-bs-target="#pills-files" type="button" role="tab" aria-controls="pills-files" aria-selected="true"><%= t('general.files') %></button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-tasks-tab" data-bs-toggle="pill" data-bs-target="#pills-tasks" type="button" role="tab" aria-controls="pills-tasks" aria-selected="false">Tasks</button>
<button class="nav-link" id="pills-tasks-tab" data-bs-toggle="pill" data-bs-target="#pills-tasks" type="button" role="tab" aria-controls="pills-tasks" aria-selected="false"><%= t('general.tasks') %></button>
</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render DashboardPageComponent.new do |c| %>
<% c.with_header_title { "Adopted Pets" } %>
<% c.with_header_title { t(".header_title") } %>
<% c.with_body do %>
<div data-controller="card">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-4 mb-5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
<div class="row">
<div class="col-xl-3 col-lg-6 col-md-12 col-12">
<%= render DataCardComponent.new do |card| %>
<% card.with_title { "Example" } %>
<% card.with_title { t(".example") } %>
<% card.with_icon_name { "users" } %>
<% card.with_value { "5" } %>
<% end %>
</div>
<div class="col-xl-3 col-lg-6 col-md-12 col-12">
<%= render DataCardComponent.new do |card| %>
<% card.with_title { "Pets" } %>
<% card.with_title { t(".pets") } %>
<% card.with_icon_name { "heart" } %>
<% card.with_value { @organization.pets.count.to_s } %>
<% end %>
</div>
<div class="col-xl-3 col-lg-6 col-md-12 col-12">
<%= link_to adopter_fosterer_adopter_applications_path, class: "card-link" do %>
<%= render DataCardComponent.new do |card| %>
<% card.with_title { "Applications" } %>
<% card.with_title { t(".applications") } %>
<% card.with_icon_name { "file-text" } %>
<% card.with_value { @application_count.to_s } %>
<% end %>
<% end %>
</div>
<div class="col-xl-3 col-lg-6 col-md-12 col-12">
<%= render DataCardComponent.new do |card| %>
<% card.with_title { "Rescues" } %>
<% card.with_title { t(".rescues") } %>
<% card.with_icon_name { "star" } %>
<% card.with_value { "TBD" } %>
<% end %>
Expand Down
14 changes: 7 additions & 7 deletions app/views/organizations/adopter_fosterer/likes/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render DashboardPageComponent.new do |c| %>
<% c.with_header_title { t('organizations.adopter_fosterer.likes.index.liked_pets') } %>
<% c.with_header_title { t('.header_title') } %>
<% c.with_body do %>
<div class="justify-content-md-between mb-4 mb-xl-0 gx-3">
<div class="row">
Expand All @@ -11,8 +11,8 @@
image_options: {src: pet.images.first, url: adoptable_pet_path(pet)}
) do |c| %>
<%= c.with_badge do %>
<%= render BadgeComponent.new("Adoption Pending", class: "badge bg-info", when: pet.has_adoption_pending?) %>
<%= render BadgeComponent.new("Adopted", class: "badge bg-warning", when: pet.is_adopted?) %>
<%= render BadgeComponent.new(t("general.adoption_pending"), class: "badge bg-info", when: pet.has_adoption_pending?) %>
<%= render BadgeComponent.new(t("general.adopted"), class: "badge bg-warning", when: pet.is_adopted?) %>
<% end %>
<%= c.with_body do %>
<ul class="list-group list-group-flush">
Expand All @@ -29,10 +29,10 @@
<% end %>
</li>
<% li_classes = %w[list-group-item text-secondary] %>
<%= tag.li("Age: #{time_ago_in_words(pet.birth_date).titleize}", class: li_classes) %>
<%= tag.li("Breed: #{pet.breed}", class: li_classes) %>
<%= tag.li("Sex: #{pet.sex}", class: li_classes) %>
<%= tag.li("Weight range: #{[pet.weight_from, pet.weight_to].join("-")} kg", class: li_classes) %>
<%= tag.li("#{t('general.age')}: #{time_ago_in_words(pet.birth_date).titleize}", class: li_classes) %>
<%= tag.li("#{t('general.breed')}: #{pet.breed}", class: li_classes) %>
<%= tag.li("#{t('general.sex')}: #{pet.sex}", class: li_classes) %>
<%= tag.li("#{t('general.weight_range')}: #{[pet.weight_from, pet.weight_to].join("-")} kg", class: li_classes) %>
</ul>
<% end %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<table class="table mb-0 text-nowrap table-hover table-centered">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Description</th>
<th scope="col">Due Date</th>
<th scope="col"><%= t('name') %></th>
<th scope="col"><%= t('description') %></th>
<th scope="col"><%= t('due_date') %></th>
</tr>
</thead>
<tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</a>
<span class="dropdown-menu">
<span class="dropdown-header"><%=t(:settings) %></span>
<a class="dropdown-item" href="#"><i class="fe fe-edit dropdown-item-icon"></i> <%= t(:edit) %></a>
<a class="dropdown-item" href="#"><i class="fe fe-edit dropdown-item-icon"></i> <%= t('general.edit') %></a>
</span>
</span>
</div>
Expand Down
17 changes: 16 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ en:
joined: "Joined"
name: "Name"
role: "Role"
description: "Description"
due_date: "Due Date"
deactivate: "Deactivate"
settings: "Settings"
invite_fosterer: "Invite Fosterer"
invite_staff: "Invite Staff"
general:
attach: "Attach"
adoption_pending: "(Adoption Pending)"
adopted: Adopted
age: "Age"
become_an_adopter: "Become an adopter"
breed: "Breed"
Expand All @@ -56,6 +59,7 @@ en:
pet: "Pet"
sex: "Sex"
weight: "Weight"
weight_range: "Weight range"
about: "About"
"yes": "Yes"
"no": "No"
Expand All @@ -77,6 +81,8 @@ en:
not_found: "Not Found"
are_you_sure_delete_pet: "Are you sure you want to delete this pet?"
organization_not_found: "Organization not found."
files: "Files"
tasks: "Tasks"
dashboard:
index:
header_title: Dashboard
Expand Down Expand Up @@ -619,14 +625,23 @@ en:
withdraw: "Withdraw"
likes:
index:
liked_pets: 'Liked Pets'
header_title: 'Liked Pets'
no_pets: 'You do not have any liked pets'
create:
success: "%{name} added to your liked pets."
failed: "Error, %{name} not added to your liked pets."
destroy:
success: "%{name} removed from your liked pets."
failed: "Error, %{name} not removed from your liked pets."
adopted_pets:
index:
header_title: "Adopted pets"
dashboard:
index:
example: Example
pets: Pets
applications: Applications
rescues: Rescues
form_instructions:
index: "Please complete this form. %{organization_name} needs this information in order to process your application(s)."
dashboard: If you need to update your information, you can do so by filling out a new copy of this form. Please only submit a new copy if there has been a change. Unnecessary submissions may delay the processing of your application(s).
Expand Down

0 comments on commit 5694781

Please sign in to comment.