Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Update policy page to use locale strings for title and last update date

Gabriel Z. Lovison55483c0b990f
diff --git a/storefront/app/views/themes/default/spree/policies/show.html.erb b/storefront/app/views/themes/default/spree/policies/show.html.erb
index ed6ee8b29f..3c20e86e43 100644
--- a/storefront/app/views/themes/default/spree/policies/show.html.erb
+++ b/storefront/app/views/themes/default/spree/policies/show.html.erb
@@ -1,11 +1,15 @@
<div class="page-container py-12">
<h1 class="text-2xl tracking-tight text-center lg:text-left mb-3 uppercase">
- <%= params[:id].titleize %>
+ <%= Spree.t(params[:id]) %>
</h1>
- <p class="mb-8 text-center lg:text-left">
- Last update: <%= @policy&.updated_at&.strftime('%d/%m/%Y') %>
- </p>
- <div class="mb-5">
- <%= @policy&.to_s %>
- </div>
+
+ <% if @policy %>
+ <p class="mb-8 text-center lg:text-left">
+ <%= Spree.t("storefront.policies.last_update_at", date: l(@policy.updated_at.to_date)) %>
+ </p>
+
+ <div class="mb-5">
+ <%= @policy&.to_s %>
+ </div>
+ <% end %>
</div>
diff --git a/storefront/config/locales/en.yml b/storefront/config/locales/en.yml
index d21a2cd426..75d5246b0c 100644
--- a/storefront/config/locales/en.yml
+++ b/storefront/config/locales/en.yml
@@ -54,6 +54,8 @@ en:
description: Take control of your settings and tailor your experience according to your preferences. Customize your notifications to suit your needs.
join: Email me about new products, sales, and more. You can unsubscribe at any time.
status: You are currently %{status} to the newsletters.
+ policies:
+ last_update_at: Last update %{date}
products:
pinch_to_zoom_html: Pinch to<br>zoom
refund_action_not_required_message: