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.

clean up i18n translations for 'storefront'

Łukasz Adamczykb6e702ca1485
diff --git a/core/app/views/spree/addresses/_form.html.erb b/core/app/views/spree/addresses/_form.html.erb
index f1c0438c29..2501a23901 100644
--- a/core/app/views/spree/addresses/_form.html.erb
+++ b/core/app/views/spree/addresses/_form.html.erb
@@ -45,7 +45,7 @@
</div>
<span class="text-sm space-x-2 items-center hidden alert alert-info mt-2 align-items-center" data-address-autocomplete-target="addressWarning">
<%= heroicon "exclamation-circle", variant: :outline if defined?(heroicon) %>
- <%= Spree.t(:add_house_number, scope: :address_book) %>
+ <%= Spree.t('address_book.add_house_number') %>
</span>
</div>
<%= address_field(address_form, :address2, address_id) %>
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index eb3a81f97b..6b3651b253 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -469,7 +469,7 @@ en:
errors:
messages:
already_confirmed: was already confirmed
- not_a_number: not a number
+ not_a_number: is not a number
not_found: not found
not_locked: was not locked
not_saved:
@@ -527,6 +527,7 @@ en:
active: Active
add: Add
add_action_of_type: Add action of type
+ add_address: Add address
add_country: Add Country
add_coupon_code: Add Coupon Code
add_new_address: Add new address
@@ -549,6 +550,8 @@ en:
add_store: New Store
add_store_credit: Add Store Credit
add_to_cart: Add To Cart
+ add_to_waitlist: Add to waitlist
+ add_to_waitlist_description: Add to waitlist description
add_variant: Add Variant
added_to_cart: Added to cart successfully!
additional_item: Additional Item
@@ -560,17 +563,17 @@ en:
delete_text: Do you really want <br /> to delete this address?
delete_title: Are you sure?
address_book:
+ add_house_number: Add a house number if you have one
add_new_shipping_address: Add new address
address_name_label: Address Name
address_name_placeholder: Give this address a unique name (Work, Home, etc.)
addresses: Addresses
- edit_address: Edit Address
label: Address Name
- new_address: New Address
no_shipping_addresses_on_file: No addresses on file
other_address: Other address
remove_address: Remove Address
- save: Save
+ set_as_default_billing_address: Set as default billing address
+ set_as_default_delivery_address: Set as default delivery address
successfully_created: Address has been successfully created.
successfully_removed: Address has been successfully removed.
successfully_saved: Saved successfully
@@ -599,6 +602,8 @@ en:
all_adjustments_opened: All adjustments successfully opened!
all_departments: All departments
all_items_have_been_returned: All items have been returned
+ all_posts: All posts
+ all_posts_with_tag: All posts with tag
all_products: All products
all_rights_reserved: All rights reserved
all_time: All time
@@ -609,6 +614,7 @@ en:
analytics: Analytics
and: and
api_keys: API keys
+ apply: Apply
apply_only_on_full_priced_items: Apply only on full priced items
approve: approve
approved_at: Approved at
@@ -643,6 +649,7 @@ en:
backordered_confirm_info: Selected item is backordered so expect delays. Are you sure you want to order it?
backordered_info: Backordered
backorders_allowed: backorders allowed
+ balance: Balance
balance_due: Balance Due
barcode: Barcode
base_amount: Base Amount
@@ -703,6 +710,8 @@ en:
categories: Categories
categorization: Categorization
category: Category
+ change: Change
+ change_password: Change password
changes_published: Changes published!
channel: Channel
charged: Charged
@@ -714,6 +723,8 @@ en:
choose_dashboard_locale: Choose Dashboard Locale
choose_location: Choose location
city: City
+ clear: Clear
+ clear_all: Clear all
clear_cache: Clear Cache
clear_cache_ok: Cache was flushed
clear_cache_warning: Clearing cache will temporarily reduce the performance of your store.
@@ -721,17 +732,21 @@ en:
clone: Clone
close: Close
close_all_adjustments: Close All Adjustments
+ close_sidebar: Close sidebar
code: Code
+ colors: Colors
company: Company
compare_at_amount: Compare at amount
compare_at_price: Compare at price
complete: complete
+ completed_at: Completed at
conditions: Conditions
configuration: Configuration
configurations: Configurations
confirm: Confirm
confirm_delete: Confirm Deletion
confirm_password: Password Confirmation
+ contact: Contact
contact_information: Contact information
contact_phone: Contact phone
contact_us: Contact us
@@ -742,6 +757,7 @@ en:
continue_selling_when_out_of_stock: Continue selling when out of stock
continue_shopping: Continue shopping
copy_id: Copy
+ copy_link: Copy link
copy_payment_link: Copy payment link
copy_to_clipboard: Copy to clipboard
cost_currency: Cost Currency
@@ -775,6 +791,7 @@ en:
coupon_code_used: The coupon code you entered has already been used. Please try again.
create: Create
create_a_new_account: Create a new account
+ create_account: Create account
create_customer: Create customer
create_new: Create new
create_new_order: Create new order
@@ -794,6 +811,7 @@ en:
currency: Currency
currency_settings: Currency Settings
current: Current
+ current_password: Current password
current_promotion_usage: 'current usage: %{count}'
custom_code: Custom code
custom_font_code: Custom font code
@@ -816,6 +834,7 @@ en:
date_range: Date Range
days_ago: Days ago
default: Default
+ default_billing_address: Default billing address
default_country: Default Country
default_country_cannot_be_deleted: Default country cannot be deleted
default_currency: Default currency
@@ -824,16 +843,19 @@ en:
news: News
resources: Resources
default_refund_amount: Default Refund Amount
+ default_shipping_address: Default shipping address
default_stock_location_name: Shop location
default_tax: Default Tax
default_tax_zone: Default Tax Zone
default_theme_name: Default
default_wishlist_name: Wishlist
delete: Delete
+ delete_address: Delete address
delete_from_taxon: Delete From Taxon
delete_selected: Delete selected
deleted: Deleted
delivery: Delivery
+ delivery_address: Delivery address
delivery_information: Delivery Information
depth: Depth
description: Description
@@ -872,6 +894,7 @@ en:
duplicate: Duplicate
duplicating: Duplicating
edit: Edit
+ edit_address: Edit address
edit_refund: Edit refund
editing_resource: Editing %{resource}
editing_rma_reason: Editing RMA Reason
@@ -902,6 +925,8 @@ en:
ending_at: Ending at
ending_in: Ending in
ends_at: Ends at
+ enter: Enter
+ enter_using_password: Enter using password
error: error
error_user_destroy_with_orders: User associated with orders cannot be destroyed
error_user_does_not_have_any_store_credits: User does not have any Store Credits available
@@ -946,6 +971,7 @@ en:
expedited_exchanges_warning: Any specified exchanges will ship to the customer immediately upon saving. The customer will be charged the full amount of the item if they do not return the original item within %{days_window} days.
expiration: Expiration
expiration_date: Expiration Date
+ explore_taxon: Explore taxon
export: Export
export_mailer:
export_done:
@@ -971,6 +997,7 @@ en:
finalize: Finalize
finalized: Finalized
find_a_taxon: Find a Taxon
+ find_your_order: Find your order
first_item: First Item
first_name: First Name
first_name_begins_with: First Name Begins With
@@ -987,6 +1014,7 @@ en:
free: Free
free_shipping: Free Shipping
free_shipping_amount: "-"
+ from: From
front_end: Front End
fulfilled_at: Fulfilled at
fulfilled_by: Fulfilled by
@@ -998,6 +1026,7 @@ en:
general_settings: General Settings
generate_code: Generate coupon code
get_back_to_the: Get back to the
+ gift_card: Gift card
gift_cards: Gift cards
go_to_category: Go to category
go_to_facebook: Go to facebook
@@ -1013,9 +1042,11 @@ en:
header_font_size_scale: Header font size scale
height: Height
help_center: Help Center
+ hide: Hide
hide_from_subcategories_nav: Hide from subcategories navigation
home: Home
home_page: homepage
+ homepage: Homepage
i18n:
available_locales: Available Locales
country: Country
@@ -1099,6 +1130,7 @@ en:
line_item: Line Item
line_item_adjustments: Line item adjustments
line_items: Line items
+ link: Link
list: List
live: Live
loading: Loading
@@ -1158,13 +1190,16 @@ en:
must_have_one_store: The resource must belong to a store.
mutable: Mutable
my_account: My Account
+ my_addresses: My addresses
my_orders: My Orders
name: Name
name_on_card: Name on card
name_or_sku: Name or SKU (enter at least first 3 characters of product name)
navigation: Navigation
new: New
+ new_address: New address
new_adjustment: New Adjustment
+ new_balance: New balance
new_billing_address: New billing address
new_country: New Country
new_customer: Create new account
@@ -1179,6 +1214,7 @@ en:
new_order_completed: New Order Completed
new_order_notifications_email: New Order Notifications Email
new_page: New Page
+ new_password: New password
new_payment: New Payment
new_payment_method: New Payment Method
new_post: New Post
@@ -1213,6 +1249,7 @@ en:
new_user: New User
new_variant: New Variant
new_zone: New Zone
+ newsletters: Newsletters
next: Next
no_actions_added: No actions added
no_address_given: No address given
@@ -1248,6 +1285,7 @@ en:
not_found: "%{resource} is not found"
not_provided: Not provided
not_risky: Not risky
+ not_subscribed: Not subscribed
note: Note
notice_messages:
icon_removed: Image has been successfully removed
@@ -1259,11 +1297,13 @@ en:
translations_saved: Translations successfully saved
variant_deleted: Variant has been deleted
variant_not_deleted: 'Variant could not be deleted. Reason: %{error}'
+ notify_me_when_available: Notify me when available
num_orders: "# Orders"
number: Number
ok: OK
on_hand: On Hand
only_active_products_can_be_added_to_cart: Draft and archived products cannot be added to cart, please mark the product as active before.
+ only_left: Only %{count} left
open: Open
open_all_adjustments: Open All Adjustments
option_name: Option name
@@ -1280,6 +1320,7 @@ en:
or_select_other_address: or select other address
order: Order
order_adjustments: Order adjustments
+ order_again: Order again
order_already_updated: The order has already been updated.
order_approved: Order approved
order_canceled: Order canceled
@@ -1326,6 +1367,7 @@ en:
payment: payment
resumed: resumed
returned: returned
+ order_status: Order status
order_success: Order placed successfully
order_success_explain: Your order information will be sent to your email
order_summary: Order Summary
@@ -1334,6 +1376,7 @@ en:
order_updated: Order Updated
orders: Orders
origin: Origin
+ other: Other
out_of_stock: Out of Stock
overview: Overview
package_from: package from
@@ -1435,11 +1478,15 @@ en:
percent: Percent
percent_per_item: Percent Per Item
permalink: Permalink
+ personal_details: Personal details
phone: Phone
+ place_now: Place now
place_order: Place Order
please_check_back_soon: Please check back soon.
please_define_payment_methods: Please define some payment methods first.
please_enter_reasonable_quantity: Please enter a reasonable quantity.
+ please_select: Please select
+ please_select_all_options: Please select all options
policies: Policies
populate_get_error: Something went wrong. Please try adding the item again.
post_categories: Post categories
@@ -1479,8 +1526,19 @@ en:
product_source:
group: From product group
manual: Manually choose
+ product_sold_out: This item is sold out
products: Products
products_cannot_be_shipped: We cannot ship %{product_names} to your current location at the moment. Please change your shipping address or remove %{product_names} from your cart.
+ products_sort_options:
+ best_selling: Best Selling
+ manual: Manual
+ name_a_z: Alphabetically, A-Z
+ name_z_a: Alphabetically, Z-A
+ newest_first: Newest
+ oldest_first: Oldest
+ price_high_to_low: Price (high-low)
+ price_low_to_high: Price (low-high)
+ relevance: Relevance
promotion: Promotion
promotion_action: Promotion Action
promotion_action_types:
@@ -1555,6 +1613,8 @@ en:
query: Query
quick_search: Quick search..
rate: Rate
+ read_less: Read less
+ read_more: Read more
reason: Reason
receive: receive
receive_stock: Receive Stock
@@ -1569,6 +1629,7 @@ en:
refunds: Refunds
register: Register
registration: Registration
+ regular_price: Regular price
reimburse: Reimburse
reimbursed: Reimbursed
reimbursement: Reimbursement
@@ -1649,6 +1710,8 @@ en:
roles: Roles
rules: Rules
safe: Safe
+ sale: Sale
+ sale_price: Sale price
sales_total: Sales Total
sales_total_description: Sales Total For All Orders
sales_totals: Sales Totals
@@ -1662,6 +1725,7 @@ en:
scope: Scope
scopes: Scopes
search: Search
+ search_all: Search all
search_by: 'Search by:'
search_engine_listing: Search engine listing
search_order_number: Order Number
@@ -1691,8 +1755,10 @@ en:
selected_quantity_not_available: selected of %{item} is not available.
send_copy_of_all_mails_to: Send Copy of All Mails To
send_mails_as: Send Mails As
+ send_message: Send message
send_payment_link: Send payment link
send_payment_link_title: Send payment link title
+ send_us_a_message: Send us a message
seo: SEO
seo_robots: SEO Robots
seo_title: SEO Title
@@ -1717,6 +1783,7 @@ en:
thanks: Thank you for your business.
track_information: 'Tracking Information: %{tracking}'
track_link: 'Tracking Link: %{url}'
+ shipment_refunded_message: You will receive a refund in the next few days.
shipment_state: Shipment State
shipment_states:
backorder: Backorder
@@ -1730,6 +1797,7 @@ en:
shipment_transfer_success: Variants successfully transferred
shipments: Shipments
shipped: Shipped
+ shipped_from: Shipped from
shipping: Shipping
shipping_address: Shipping Address
shipping_categories: Shipping Categories
@@ -1740,6 +1808,7 @@ en:
shipping_instructions: Shipping Instructions
shipping_method: Shipping Method
shipping_methods: Shipping Methods
+ shipping_not_available: Shipping not available
shipping_policy: Shipping Policy
shipping_price_sack: Price sack
shipping_rates:
@@ -1753,9 +1822,11 @@ en:
shopping_cart: Shopping Cart
show: Show
show_active: Show Active
+ show_all: Show all
show_deleted: Show Deleted
show_details: Show details
show_discontinued: Show Discontinued
+ show_less: Show less
show_only_complete_orders: Only show complete orders
show_only_considered_risky: Only show risky orders
show_property: Show Property
@@ -1764,6 +1835,7 @@ en:
show_store_selector:
long: Display the Store selector in the main nav bar of Storefront and allow users to change Store and Currency
short: Show Store selector
+ sign_out: Sign out
sign_up: Sign Up
site_name: Site name
size: Size
@@ -1772,7 +1844,9 @@ en:
slug: Slug
social: Social
social_media: Social media
+ sold_out: Sold out
something_went_wrong: Something went wrong
+ sort_by: Sort by
source: Source
special_instructions: Special Instructions
split: Split
@@ -1895,10 +1969,10 @@ en:
store_not_set_as_default: Couldn't set store %{store} as a default store
store_set_as_default: Store %{store} is now a default store
store_set_default_button: Set as default
- storefront: Storefront
stores: Stores
street_address: Street Address
street_address_2: Street Address (cont'd)
+ subscribed: Subscribed
subtotal: Subtotal
subtract: Subtract
success: Success
@@ -1981,12 +2055,15 @@ en:
title: Title
title_link: Title link
to_add_variants_you_must_first_define: To add variants, you must first define
+ toggle_menu: Toggle menu
+ top_suggestions: Top suggestions
total: Total
total_per_item: Total per item
total_pre_tax_refund: Total Pre-Tax Refund
total_price: Total price
total_sales: Total Sales
track_inventory: Track Inventory
+ track_items: Track items
track_quantity: Track quantity
tracking: Tracking
tracking_number: Tracking Number
@@ -2056,6 +2133,8 @@ en:
vendors: Vendors
version: Version
view: View
+ view_all: View all
+ view_full_details: View full details
view_store: View store
view_your_store: View your store
visibility: Visibility
@@ -2075,6 +2154,7 @@ en:
what_is_a_cvv: What is a (CVV) Credit Card Code?
what_is_this: What's This?
width: Width
+ wishlist: Wishlist
without_taxon: Without taxon
year: Year
you_have_no_orders_yet: You have no orders yet
diff --git a/storefront/app/controllers/spree/addresses_controller.rb b/storefront/app/controllers/spree/addresses_controller.rb
index 52d787516b..07fb0d601c 100644
--- a/storefront/app/controllers/spree/addresses_controller.rb
+++ b/storefront/app/controllers/spree/addresses_controller.rb
@@ -24,7 +24,7 @@ module Spree
end
end
else
- redirect_to spree.account_addresses_path, notice: Spree.t(:successfully_created, scope: :address_book)
+ redirect_to spree.account_addresses_path, notice: Spree.t('address_book.successfully_created')
end
else
render action: 'new', status: :unprocessable_entity
@@ -57,7 +57,7 @@ module Spree
@address = result.value
if result.success?
- flash[:notice] = Spree.t(:successfully_updated, scope: :address_book) unless turbo_frame_request?
+ flash[:notice] = Spree.t('address_book.successfully_updated') unless turbo_frame_request?
if params[:checkout].present?
respond_to do |format|
@@ -77,7 +77,7 @@ module Spree
def destroy
@address.destroy
- redirect_to(spree.account_addresses_path, status: :see_other, notice: Spree.t(:successfully_removed, scope: :address_book))
+ redirect_to(spree.account_addresses_path, status: :see_other, notice: Spree.t('address_book.successfully_removed'))
end
private
diff --git a/storefront/app/controllers/spree/contacts_controller.rb b/storefront/app/controllers/spree/contacts_controller.rb
index 81e65cbfb3..63050726f5 100644
--- a/storefront/app/controllers/spree/contacts_controller.rb
+++ b/storefront/app/controllers/spree/contacts_controller.rb
@@ -13,7 +13,7 @@ module Spree
@contact.request = request
if @contact.deliver
- flash[:success] = 'Message sent!'
+ flash[:success] = Spree.t('storefront.contacts.message_sent')
else
message_not_sent
end
@@ -36,13 +36,13 @@ module Spree
}
)
- flash[:error] = "Unfortunately we weren't able to send the email at this time. Please try again later"
+ flash[:error] = Spree.t('storefront.contacts.message_not_sent')
end
def ensure_customer_support_email
return if current_store.customer_support_email.present?
- flash[:error] = Spree.t(:customer_support_email_not_configured)
+ flash[:error] = Spree.t('storefront.contacts.customer_support_email_not_configured')
redirect_back_or_default root_path
end
end
diff --git a/storefront/app/views/spree/addresses/edit.html.erb b/storefront/app/views/spree/addresses/edit.html.erb
index 08f887f3fd..8f04057c82 100644
--- a/storefront/app/views/spree/addresses/edit.html.erb
+++ b/storefront/app/views/spree/addresses/edit.html.erb
@@ -22,7 +22,7 @@
</div>
<div class="lg:col-span-6 lg:col-start-4">
<div class="pb-4 border-b border-default -mx-4 lg:mx-0 px-4 lg:px-8">
- <h3 class="text-xl uppercase font-medium lg:font-semibold"><%= Spree.t(:edit_address, scope: :address_book) %></h3>
+ <h3 class="text-xl uppercase font-medium lg:font-semibold"><%= Spree.t(:edit_address) %></h3>
</div>
<%= render 'spree/shared/error_messages', target: @address %>
<%= form_for @address, html: { id: 'checkout_form_address' }, method: :put do |f| %>
diff --git a/storefront/app/views/spree/addresses/new.html.erb b/storefront/app/views/spree/addresses/new.html.erb
index 7ee177da8c..7f0bda8851 100644
--- a/storefront/app/views/spree/addresses/new.html.erb
+++ b/storefront/app/views/spree/addresses/new.html.erb
@@ -11,14 +11,14 @@
<%= hidden_field_tag :order_token, params[:order_token] %>
<%= hidden_field_tag "default_shipping", true %>
<%= hidden_field_tag "default_billing", true %>
- <%= f.submit t(:save, scope: :address_book), class: 'btn-primary w-48 text-center', id: 'save-btn' %>
+ <%= f.submit Spree.t('actions.save'), class: 'btn-primary w-48 text-center', id: 'save-btn' %>
<% end %>
</div>
<% end %>
<% else %>
<% if params[:checkout].present? %>
<div class="card-dialog mx-auto lg:w-1/3">
- <h3 class="mb-5 font-semibold"><%= Spree.t(:new_address, scope: :address_book) %></h3>
+ <h3 class="mb-5 font-semibold"><%= Spree.t(:new_address) %></h3>
<%= render 'spree/shared/error_messages', target: @address %>
<%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
<%= render 'spree/addresses/form',
@@ -27,7 +27,7 @@
address_type: 'shipping',
address: @address %>
<div class="flex justify-between items-center">
- <%= f.submit t(:save, scope: :address_book), class: 'btn-primary w-48 text-center', id: 'save-btn' %>
+ <%= f.submit Spree.t('actions.save'), class: 'btn-primary w-48 text-center', id: 'save-btn' %>
<%= link_to Spree.t('actions.discard'), :back, class: 'btn btn-light w-25 !py-2' %>
</div>
<% end %>
@@ -39,7 +39,7 @@
</div>
<div class="lg:col-span-6 lg:col-start-4">
<div class="pb-4 border-b border-default -mx-4 lg:mx-0 px-4 lg:px-8">
- <h3 class="text-xl uppercase font-medium lg:font-semibold"><%= Spree.t(:add_address, scope: :address_book) %></h3>
+ <h3 class="text-xl uppercase font-medium lg:font-semibold"><%= Spree.t(:add_address) %></h3>
</div>
<%= render 'spree/shared/error_messages', target: @address %>
<%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
@@ -53,11 +53,11 @@
<div class="lg:px-8 pb-4">
<%= label_tag "default_shipping", class: 'flex items-center gap-2 text-sm mb-4' do %>
<%= check_box_tag "default_shipping", "true", true, class: 'input-checkbox' %>
- <%= Spree.t(:set_as_default_delivery_address, scope: :address_book) %>
+ <%= Spree.t('address_book.set_as_default_delivery_address') %>
<% end %>
<%= label_tag "default_billing", class: 'flex items-center gap-2 text-sm mb-4' do %>
<%= check_box_tag "default_billing", "true", true, class: 'input-checkbox' %>
- <%= Spree.t(:set_as_default_billing_address, scope: :address_book) %>
+ <%= Spree.t('address_book.set_as_default_billing_address') %>
<% end %>
</div>
<div class="border-t border-default -mx-4 lg:mx-0 px-4 flex justify-end items-center gap-4 py-6 lg:px-8">
diff --git a/storefront/app/views/spree/checkout/_address.html.erb b/storefront/app/views/spree/checkout/_address.html.erb
index 6b66f7112f..8e3c933b11 100644
--- a/storefront/app/views/spree/checkout/_address.html.erb
+++ b/storefront/app/views/spree/checkout/_address.html.erb
@@ -32,7 +32,7 @@
<div class="custom-control custom-radio px-5 py-4 flex items-center">
<%= radio_button_tag "order_#{address_name}_id", 0, false, class: 'custom-control-input radio-input mr-5', data: { action: 'checkout-address-book#select' } %>
<label class="custom-control-label d-block select-none cursor-pointer w-full max-w-[calc(100%-58px)]" for="<%= "order_#{address_name}_id_0" %>">
- <%= Spree.t(:new_address, scope: :address_book) %>
+ <%= Spree.t(:new_address) %>
<div class="mt-4 hidden" data-checkout-address-book-target="newAddressForm">
<%= turbo_frame_tag :new_address do %>
<%= form_for try_spree_current_user.addresses.build(country: current_store.default_country), html: { id: 'checkout_form_address' } do |f| %>
@@ -44,7 +44,7 @@
<%= hidden_field_tag :order_token, @order.token %>
<%= hidden_field_tag "default_shipping", true %>
<%= hidden_field_tag "default_billing", true %>
- <%= f.submit t(:save, scope: :address_book), class: 'btn btn-primary btn-block spree-btn mb-5' %>
+ <%= f.submit Spree.t('actions.save'), class: 'btn btn-primary btn-block spree-btn mb-5' %>
<% end %>
<% end %>
</div>
@@ -85,7 +85,7 @@
<% if !already_have_an_account? && defined?(spree_login_path) %>
<div class="lg:text-right">
<span class="text-gray-600 text-sm">
- <%= Spree.t(:already_have_an_account) %> <span class="text-primary"><%= link_to Spree.t(:login), spree_login_path, data: { turbo_frame: '_top' } %></span>
+ <%= Spree.t('storefront.checkout.already_have_an_account') %> <span class="text-primary"><%= link_to Spree.t(:login), spree_login_path, data: { turbo_frame: '_top' } %></span>
</span>
</div>
<% end %>
@@ -99,7 +99,7 @@
<div class="flex items-center gap-2">
<%= form.check_box :accept_marketing, class: 'checkbox-input' %>
<%= form.label :accept_marketing, class: 'cursor-pointer text-sm select-none' do %>
- <%= Spree.t('newsletter_subscription.join') %>
+ <%= Spree.t('storefront.newsletter_subscription.join') %>
<% end %>
</div>
@@ -107,7 +107,7 @@
<div class="flex items-center gap-2 mt-2">
<%= form.check_box :signup_for_an_account, class: 'checkbox-input' %>
<%= form.label :signup_for_an_account, class: 'cursor-pointer text-sm select-none' do %>
- <%= Spree.t(:signup_for_an_account) %>
+ <%= Spree.t('storefront.checkout.signup_for_an_account') %>
<% end %>
</div>
<% end %>
diff --git a/storefront/app/views/spree/checkout/_missing_line_items.html.erb b/storefront/app/views/spree/checkout/_missing_line_items.html.erb
index 891fd5b04b..619b786100 100644
--- a/storefront/app/views/spree/checkout/_missing_line_items.html.erb
+++ b/storefront/app/views/spree/checkout/_missing_line_items.html.erb
@@ -5,7 +5,7 @@
<div class="p-8">
<h2 class="text-xl mb-4"><%= Spree.t('storefront.checkout.shipping_not_available') %></h2>
<p class="mb-4">
- <%= Spree.t('checkout.errors.invalid_line_items', count: @order.line_items_without_shipping_rates.size) %>
+ <%= Spree.t('storefront.checkout.errors.invalid_line_items', count: @order.line_items_without_shipping_rates.size) %>
</p>
<div class="mb-5 overflow-y-auto pt-3 mx-3 lg:mx-8 lg:mt-4 lg:pt-6 line-items" data-checkout-summary-target="line_items">
diff --git a/storefront/app/views/spree/checkout/_summary.html.erb b/storefront/app/views/spree/checkout/_summary.html.erb
index 29369c6483..8935ce3f8e 100644
--- a/storefront/app/views/spree/checkout/_summary.html.erb
+++ b/storefront/app/views/spree/checkout/_summary.html.erb
@@ -53,7 +53,7 @@
<% elsif order.state == 'address' %>
<div class="flex justify-between items-center mb-2">
<span><%= Spree.t(:shipping) %>:</span>
- <span class="text-xs text-gray-500"><%= Spree.t(:calculated_at_next_step) %></span>
+ <span class="text-xs text-gray-500"><%= Spree.t('storefront.checkout.calculated_at_next_step') %></span>
</div>
<% end %>
diff --git a/storefront/app/views/spree/checkout/payment/_store_credit.html.erb b/storefront/app/views/spree/checkout/payment/_store_credit.html.erb
index f2073f8e64..d50724ae89 100644
--- a/storefront/app/views/spree/checkout/payment/_store_credit.html.erb
+++ b/storefront/app/views/spree/checkout/payment/_store_credit.html.erb
@@ -2,12 +2,12 @@
<div class="d-flex flex-column mb-5" data-hook="checkout_payment_store_credit_success">
<p class="store-credit-title font-body">
<% if @order.respond_to?(:gift_card) && @order.gift_card.present? %>
- <%= Spree.t(:gift_card_amount_applied, amount: @order.display_gift_card_total, code: @order.gift_card.code) %>
+ <%= Spree.t('storefront.checkout.gift_card_amount_applied', amount: @order.display_gift_card_total, code: @order.gift_card.code) %>
<% else %>
- <%= Spree.t(:store_credits_amount_applied, amount: @order.display_total_applicable_store_credit.abs) %>
+ <%= Spree.t('storefront.checkout.store_credits_amount_applied', amount: @order.display_total_applicable_store_credit.abs) %>
<% end %>
- <%= Spree.t(:you_will_need_to_pay_only, amount: @order.display_total_minus_store_credits) %>
+ <%= Spree.t('storefront.checkout.you_will_need_to_pay_only', amount: @order.display_total_minus_store_credits) %>
</p>
</div>
<% end %>
diff --git a/storefront/app/views/themes/default/spree/account/addresses/index.html.erb b/storefront/app/views/themes/default/spree/account/addresses/index.html.erb
index 9a79cdf1b1..5f38ff52a6 100644
--- a/storefront/app/views/themes/default/spree/account/addresses/index.html.erb
+++ b/storefront/app/views/themes/default/spree/account/addresses/index.html.erb
@@ -16,8 +16,8 @@
</div>
<% else %>
<div class="text-center py-6">
- <p class="mb-2 font-medium uppercase"><%= Spree.t(:no_addresses_title) %></p>
- <p><%= Spree.t(:no_addresses_description) %></p>
+ <p class="mb-2 font-medium uppercase"><%= Spree.t('storefront.account.no_addresses_title') %></p>
+ <p><%= Spree.t('storefront.account.no_addresses_description') %></p>
<div class="flex mt-8 justify-center">
<%= link_to Spree.t(:add), spree.new_address_path, class: 'btn-primary block' %>
</div>
diff --git a/storefront/app/views/themes/default/spree/account/orders/index.html.erb b/storefront/app/views/themes/default/spree/account/orders/index.html.erb
index e4fef6400c..20c94a99b4 100644
--- a/storefront/app/views/themes/default/spree/account/orders/index.html.erb
+++ b/storefront/app/views/themes/default/spree/account/orders/index.html.erb
@@ -13,8 +13,8 @@
<!-- add pagination -->
<% else %>
<div class="text-center my-16 lg:my14">
- <p class="mb-2 font-medium uppercase"><%= Spree.t(:no_orders_title) %></p>
- <p><%= Spree.t(:no_orders_description) %></p>
+ <p class="mb-2 font-medium uppercase"><%= Spree.t('storefront.account.no_orders_title') %></p>
+ <p><%= Spree.t('storefront.account.no_orders_description') %></p>
<div class="flex justify-center mt-8">
<%= link_to Spree.t(:shop_all), spree.root_url, class: 'btn-primary flex' %>
</div>
diff --git a/storefront/app/views/themes/default/spree/account/store_credits/index.html.erb b/storefront/app/views/themes/default/spree/account/store_credits/index.html.erb
index f03bbafe21..2af2f26a28 100644
--- a/storefront/app/views/themes/default/spree/account/store_credits/index.html.erb
+++ b/storefront/app/views/themes/default/spree/account/store_credits/index.html.erb
@@ -9,7 +9,7 @@
</div>
</div>
<% if @store_credit_events.any? %>
- <p class="text-neutral-600 mb-3"><%= Spree.t(:store_credits_history) %></p>
+ <p class="text-neutral-600 mb-3"><%= Spree.t('storefront.account.store_credits_history') %></p>
<table class="inline-table md:table table-auto overflow-scroll w-full text-sm border-separate border-spacing-y-4 mb-24 mt-4">
<thead class="hidden md:table-row-group">
@@ -25,7 +25,7 @@
</tbody>
</table>
<% else %>
- <p class="text-neutral-600"><%= Spree.t(:no_store_credits) %></p>
+ <p class="text-neutral-600"><%= Spree.t('storefront.account.no_store_credits') %></p>
<% end %>
</div>
</div>
diff --git a/storefront/app/views/themes/default/spree/checkout/complete.html.erb b/storefront/app/views/themes/default/spree/checkout/complete.html.erb
index 7ea97124b8..a92544893a 100644
--- a/storefront/app/views/themes/default/spree/checkout/complete.html.erb
+++ b/storefront/app/views/themes/default/spree/checkout/complete.html.erb
@@ -3,15 +3,15 @@
<%= Spree.t(:order) %> <strong><%= @order.number %></strong>
</p>
<h4 class="mb-4 text-green-600 font-semibold text-lg font-body">
- <%= Spree.t(:thanks_for_your_order, name: @order.bill_address_firstname) %>
+ <%= Spree.t('storefront.checkout.thanks_for_your_order', name: @order.bill_address_firstname) %>
</h4>
<div class="border p-3 rounded-md">
<h5 class="mb-3 font-semibold pb-3 border-b font-body">
- <%= Spree.t(:order_success) %>
+ <%= Spree.t('storefront.checkout.order_success') %>
</h6>
<p class="mb-0">
- <%= Spree.t(:order_success_message) %>
+ <%= Spree.t('storefront.checkout.order_success_message') %>
</p>
</div>
@@ -31,7 +31,7 @@
</div>
<% unless @order.payment_state.present? %>
- <p class="mb-0 mt-3 text-sm"><%= Spree.t(:payment_processing_message) %></p>
+ <p class="mb-0 mt-3 text-sm"><%= Spree.t('storefront.checkout.payment_processing_message') %></p>
<% end %>
</div>
<% end %>
diff --git a/storefront/app/views/themes/default/spree/orders/_summary.html.erb b/storefront/app/views/themes/default/spree/orders/_summary.html.erb
index f82a052458..1fee0c0ca2 100644
--- a/storefront/app/views/themes/default/spree/orders/_summary.html.erb
+++ b/storefront/app/views/themes/default/spree/orders/_summary.html.erb
@@ -2,7 +2,7 @@
<% if order.line_items.any? %>
<div class="cart-summary-container p-4">
<p class="text-center lg:text-right text-sm mb-3">
- <%= Spree.t(:shipping_and_taxes_calculated_at_checkout) %>
+ <%= Spree.t('storefront.cart.shipping_and_taxes_calculated_at_checkout') %>
</p>
<div class="shopping-cart-total-text text-center lg:text-right uppercase font-medium">
diff --git a/storefront/app/views/themes/default/spree/products/_add_to_waitlist.html.erb b/storefront/app/views/themes/default/spree/products/_add_to_waitlist.html.erb
index decc334c17..38c356831b 100644
--- a/storefront/app/views/themes/default/spree/products/_add_to_waitlist.html.erb
+++ b/storefront/app/views/themes/default/spree/products/_add_to_waitlist.html.erb
@@ -27,7 +27,7 @@
<div class="flex flex-col gap-2">
<label class="flex items-center gap-2 cursor-pointer group text-sm">
<%= f.check_box :subscribe_to_newsletter, class: 'input-checkbox group-focus-within:outline' %>
- <%= Spree.t('newsletter_subscription.join') %>
+ <%= Spree.t('storefront.newsletter_subscription.join') %>
</label>
<%= f.button Spree.t(:add_to_waitlist), type: 'submit', class: 'btn-primary w-full btn-icon h-12', disabled: true, data: { enable_button_target: 'button' } %>
</div>
diff --git a/storefront/app/views/themes/default/spree/products/_variant_picker.html.erb b/storefront/app/views/themes/default/spree/products/_variant_picker.html.erb
index b1d1d28d2c..9ed54dc8be 100644
--- a/storefront/app/views/themes/default/spree/products/_variant_picker.html.erb
+++ b/storefront/app/views/themes/default/spree/products/_variant_picker.html.erb
@@ -24,7 +24,7 @@
<% if selected_option %>
<%= option_type.presentation %>: <span class="option-value-text"><%= selected_option.presentation %></span>
<% else %>
- <%= Spree.t('variant_picker.please_choose', option_type: option_type.presentation) %>
+ <%= Spree.t('storefront.variant_picker.please_choose', option_type: option_type.presentation) %>
<% end %>
</legend>
<% render 'spree/shared/icons/chevron_down' %>
diff --git a/storefront/app/views/themes/default/spree/shared/_cart_icon.html.erb b/storefront/app/views/themes/default/spree/shared/_cart_icon.html.erb
index 2b5c13eec8..81a9527093 100644
--- a/storefront/app/views/themes/default/spree/shared/_cart_icon.html.erb
+++ b/storefront/app/views/themes/default/spree/shared/_cart_icon.html.erb
@@ -8,6 +8,6 @@
<span class='cart-counter w-full text-[8px] font-extrabold absolute top-[10px] text-center'>
<%= current_order.item_count if current_order&.item_count&.positive? %>
</span>
- <span class='sr-only'><%= Spree.t(:items_in_cart) %>, <%= Spree.t(:view_bag) %></span>
+ <span class='sr-only'><%= Spree.t('storefront.cart.items_in_cart') %>, <%= Spree.t('storefront.cart.view_bag') %></span>
<% end %>
<% end %>
diff --git a/storefront/app/views/themes/default/spree/shared/_cart_pane.html.erb b/storefront/app/views/themes/default/spree/shared/_cart_pane.html.erb
index e6bc716396..efd076a481 100644
--- a/storefront/app/views/themes/default/spree/shared/_cart_pane.html.erb
+++ b/storefront/app/views/themes/default/spree/shared/_cart_pane.html.erb
@@ -27,7 +27,7 @@
<span class='cart-counter w-full text-[8px] font-extrabold absolute top-[10px] text-center'>
<%= current_order.item_count if current_order.present? && current_order.item_count.to_i > 0 %>
</span>
- <span class='sr-only'><%= Spree.t(:items_in_cart) %>, <%= Spree.t(:view_bag) %></span>
+ <span class='sr-only'><%= Spree.t('storefront.cart.items_in_cart') %>, <%= Spree.t('storefront.cart.view_bag') %></span>
</span>
</div>
<div class='flex-1 h-0 overflow-y-auto'>
diff --git a/storefront/config/i18n-tasks.yml b/storefront/config/i18n-tasks.yml
new file mode 100644
index 0000000000..636f960102
--- /dev/null
+++ b/storefront/config/i18n-tasks.yml
@@ -0,0 +1,178 @@
+# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
+
+# The "main" locale.
+base_locale: en
+## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
+# locales: [es, fr]
+## Reporting locale, default: en. Available: en, ru.
+# internal_locale: en
+
+# Read and write translations.
+data:
+ ## Translations are read from the file system. Supported format: YAML, JSON.
+ ## Provide a custom adapter:
+ # adapter: I18n::Tasks::Data::FileSystem
+
+ # Locale files or `Dir.glob` patterns where translations are read from:
+ read:
+ ## Default:
+ - config/locales/%{locale}.yml
+ ## More files:
+ # - config/locales/**/*.%{locale}.yml
+
+ # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
+ write:
+ ## For example, write devise and simple form keys to their respective files:
+ # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
+ ## Catch-all default:
+ # - config/locales/%{locale}.yml
+
+ # External locale data (e.g. gems).
+ # This data is not considered unused and is never written to.
+ external:
+ ## Example (replace %#= with %=):
+ # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
+ - "<%= %x[bundle info spree_core --path].chomp %>/config/locales/%{locale}.yml"
+
+ ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
+ # router: conservative_router
+
+ yaml:
+ write:
+ # do not wrap lines at 80 characters
+ line_width: -1
+
+ ## Pretty-print JSON:
+ # json:
+ # write:
+ # indent: ' '
+ # space: ' '
+ # object_nl: "\n"
+ # array_nl: "\n"
+
+# Find translate calls
+search:
+ ## Paths or `Find.find` patterns to search in:
+ # paths:
+ # - app/
+
+ ## Root directories for relative keys resolution.
+ # relative_roots:
+ # - app/controllers
+ # - app/helpers
+ # - app/mailers
+ # - app/presenters
+ # - app/views
+
+ ## Directories where method names which should not be part of a relative key resolution.
+ # By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
+ # Directories listed here will not consider the name of the method part of the resolved key
+ #
+ # relative_exclude_method_name_paths:
+ # -
+
+ ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
+ ## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
+ ## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
+ exclude:
+ - app/assets/images
+ - app/assets/fonts
+ - app/assets/videos
+ - app/assets/builds
+
+ ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
+ ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
+ # only: ["*.rb", "*.html.slim"]
+
+ ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
+ strict: false
+
+ ## Allows adding ast_matchers for finding translations using the AST-scanners
+ ## The available matchers are:
+ ## - RailsModelMatcher
+ ## Matches ActiveRecord translations like
+ ## User.human_attribute_name(:email) and User.model_name.human
+ ## - DefaultI18nSubjectMatcher
+ ## Matches ActionMailer's default_i18n_subject method
+ ##
+ ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
+ # ast_matchers:
+ # - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'
+ # - 'I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher'
+
+ ## Multiple scanners can be used. Their results are merged.
+ ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
+ ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
+
+## Translation Services
+# translation:
+# # Google Translate
+# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
+# google_translate_api_key: "AbC-dEf5"
+# # DeepL Pro Translate
+# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
+# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
+# # deepl_host: "https://api.deepl.com"
+# # deepl_version: "v2"
+# # deepl_glossary_ids:
+# # - f28106eb-0e06-489e-82c6-8215d6f95089
+# # - 2c6415be-1852-4f54-9e1b-d800463496b4
+# # add additional options to the DeepL.translate call: https://www.deepl.com/docs-api/translate-text/translate-text/
+# deepl_options:
+# formality: prefer_less
+# # OpenAI
+# openai_api_key: "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+# # openai_model: "gpt-3.5-turbo" # see https://platform.openai.com/docs/models
+# # may contain `%{from}` and `%{to}`, which will be replaced by source and target locale codes, respectively (using `Kernel.format`)
+# # openai_system_prompt: >-
+# # You are a professional translator that translates content from the %{from} locale
+# # to the %{to} locale in an i18n locale array.
+# #
+# # The array has a structured format and contains multiple strings. Your task is to translate
+# # each of these strings and create a new array with the translated strings.
+# #
+# # HTML markups (enclosed in < and > characters) must not be changed under any circumstance.
+# # Variables (starting with %%{ and ending with }) must not be changed under any circumstance.
+# #
+# # Keep in mind the context of all the strings for a more accurate translation.
+
+## Do not consider these keys missing:
+# ignore_missing:
+# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
+# - '{devise,simple_form}.*'
+
+## Consider these keys used:
+# ignore_unused:
+# - 'activerecord.attributes.*'
+# - '{devise,kaminari,will_paginate}.*'
+# - 'simple_form.{yes,no}'
+# - 'simple_form.{placeholders,hints,labels}.*'
+# - 'simple_form.{error_notification,required}.:'
+
+## Exclude these keys from the `i18n-tasks eq-base' report:
+# ignore_eq_base:
+# all:
+# - common.ok
+# fr,es:
+# - common.brand
+
+## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
+# ignore_inconsistent_interpolations:
+# - 'activerecord.attributes.*'
+
+## Ignore these keys completely:
+# ignore:
+# - kaminari.*
+
+## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
+## e.g. in case of a relative key defined in a helper method.
+## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
+#
+# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
+# only: %w(*.html.haml *.html.slim),
+# patterns: [['= title\b', '.page_title']] %>
+#
+# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
+#
+<% I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
diff --git a/storefront/config/locales/en.yml b/storefront/config/locales/en.yml
index 8a2865a9f0..0ab1df578e 100644
--- a/storefront/config/locales/en.yml
+++ b/storefront/config/locales/en.yml
@@ -1,29 +1,60 @@
+---
en:
spree:
storefront:
- add_to_wishlist: Add to wishlist
+ account:
+ change_password: Change password
+ newsletter_settings: Newsletter settings
+ no_addresses_description: If you place an order, you will find address details here.
+ no_addresses_title: You currently have no Addresses
+ no_orders_description: If you place an order, you will find details here.
+ no_orders_title: You currently have no orders
+ no_store_credits: You don't have any store credit.
+ personal_details: Personal details
+ please_update_your_contact_details: Please update your contact details
+ store_credits_history: Store credits history
+ cart:
+ items_in_cart: Items in cart
+ shipping_and_taxes_calculated_at_checkout: Shipping & taxes calculated at checkout
+ view_bag: View bag
checkout:
- already_have_an_account: Already have an account?
all_transactions_are_secure_and_encrypted: All transactions are secure and encrypted
- back_to_cart: Back to cart
+ already_have_an_account: Already have an account?
by_placing_this_order_you_agree_to: By placing this order you agree to
+ calculated_at_next_step: Calculated at next step
continue_to_cart: Continue to cart
continue_to_checkout: Continue to checkout
delivery_method: Delivery method
+ errors:
+ invalid_line_items:
+ one: This item will be removed from your cart because there are no delivery methods available for your address.
+ other: These %{count} items will be removed from your cart because there are no delivery methods available for your address.
gift_card_amount_applied: Gift card %{code} applied %{amount} to your order.
order_already_paid: You don't need to pay anything, just click Place now button to confirm the order.
+ order_success: Your order is confirmed!
+ order_success_message: When your order is ready, you will receive an email confirmation.
+ payment_processing_message: You will receive an email confirmation when your payment is processed.
shipping_not_available: Shipping not available
+ signup_for_an_account: Create an account for faster future purchases, order tracking, and more.
store_credits_amount_applied: You applied a %{amount} store credit to your order.
- errors:
- invalid_line_items:
- one: 'This item will be removed from your cart because there are no delivery methods available for your address.'
- other: 'These %{count} items will be removed from your cart because there are no delivery methods available for your address.'
+ thanks_for_your_order: Thanks %{name} for your order!
+ you_will_need_to_pay_only: You will need to pay only %{amount} with your payment method of choosing.
+ contacts:
+ customer_support_email_not_configured: Customer support email is not configured
+ message_not_sent: Unfortunately we weren't able to send the email at this time. Please try again later
+ message_sent: Message sent!
+ newsletter_subscription:
+ 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.
+ variant_picker:
+ please_choose: Please choose %{option_type}
wished_items:
- select_variant: Select variant to add to wishlist
- remove_error: 'You already removed this item from your wishlist'
- remove: Remove from wishlist
- unavailable: Unavailable
+ add: Add to wishlist
no_wished_items:
- title: You have no Saved Items
description: You have no saved items yet.
-
\ No newline at end of file
+ title: You have no saved items
+ remove: Remove from wishlist
+ remove_error: You already removed this item from your wishlist
+ select_variant: Select variant to add to wishlist
+ unavailable: Unavailable
diff --git a/storefront/spec/controllers/spree/addresses_controller_spec.rb b/storefront/spec/controllers/spree/addresses_controller_spec.rb
index 3b0166d3fa..6a9fa58954 100644
--- a/storefront/spec/controllers/spree/addresses_controller_spec.rb
+++ b/storefront/spec/controllers/spree/addresses_controller_spec.rb
@@ -49,7 +49,7 @@ describe Spree::AddressesController, type: :controller do
it 'sets flash message' do
post_create
- expect(flash[:notice]).to eq Spree.t(:successfully_created, scope: :address_book)
+ expect(flash[:notice]).to eq Spree.t('address_book.successfully_created')
end
context 'default address' do
@@ -127,7 +127,7 @@ describe Spree::AddressesController, type: :controller do
it 'sets flash message' do
put_update
- expect(flash[:notice]).to eq Spree.t(:successfully_updated, scope: :address_book)
+ expect(flash[:notice]).to eq Spree.t('address_book.successfully_updated')
end
it 'returns 302 status code' do
@@ -180,7 +180,7 @@ describe Spree::AddressesController, type: :controller do
it 'sets flash message' do
put_update
- expect(flash[:notice]).to eq Spree.t(:successfully_updated, scope: :address_book)
+ expect(flash[:notice]).to eq Spree.t('address_book.successfully_updated')
end
it 'returns 302 status code' do
diff --git a/storefront/spec/i18n_spec.rb b/storefront/spec/i18n_spec.rb
new file mode 100644
index 0000000000..98d90f9407
--- /dev/null
+++ b/storefront/spec/i18n_spec.rb
@@ -0,0 +1,33 @@
+require 'spec_helper'
+require 'i18n/tasks'
+
+RSpec.describe I18n do
+ let(:i18n) { I18n::Tasks::BaseTask.new }
+ let(:missing_keys) { i18n.missing_keys }
+ let(:unused_keys) { i18n.unused_keys }
+ let(:inconsistent_interpolations) { i18n.inconsistent_interpolations }
+
+ it 'does not have missing keys' do
+ expect(missing_keys).to be_empty,
+ "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"
+ end
+
+ it 'does not have unused keys' do
+ expect(unused_keys).to be_empty,
+ "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them"
+ end
+
+ it 'files are normalized' do
+ non_normalized = i18n.non_normalized_paths
+ error_message = "The following files need to be normalized:\n" \
+ "#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \
+ "Please run `i18n-tasks normalize' to fix"
+ expect(non_normalized).to be_empty, error_message
+ end
+
+ it 'does not have inconsistent interpolations' do
+ error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \
+ "Run `i18n-tasks check-consistent-interpolations' to show them"
+ expect(inconsistent_interpolations).to be_empty, error_message
+ end
+end