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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
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.erbindex 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.ymlindex 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 numbernot_found: not foundnot_locked: was not lockednot_saved:@@ -527,6 +527,7 @@ en:active: Activeadd: Addadd_action_of_type: Add action of type+ add_address: Add addressadd_country: Add Countryadd_coupon_code: Add Coupon Codeadd_new_address: Add new address@@ -549,6 +550,8 @@ en:add_store: New Storeadd_store_credit: Add Store Creditadd_to_cart: Add To Cart+ add_to_waitlist: Add to waitlist+ add_to_waitlist_description: Add to waitlist descriptionadd_variant: Add Variantadded_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 oneadd_new_shipping_address: Add new addressaddress_name_label: Address Nameaddress_name_placeholder: Give this address a unique name (Work, Home, etc.)addresses: Addresses- edit_address: Edit Addresslabel: Address Name- new_address: New Addressno_shipping_addresses_on_file: No addresses on fileother_address: Other addressremove_address: Remove Address- save: Save+ set_as_default_billing_address: Set as default billing address+ set_as_default_delivery_address: Set as default delivery addresssuccessfully_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 departmentsall_items_have_been_returned: All items have been returned+ all_posts: All posts+ all_posts_with_tag: All posts with tagall_products: All productsall_rights_reserved: All rights reservedall_time: All time@@ -609,6 +614,7 @@ en:analytics: Analyticsand: andapi_keys: API keys+ apply: Applyapply_only_on_full_priced_items: Apply only on full priced itemsapprove: approveapproved_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: Backorderedbackorders_allowed: backorders allowed+ balance: Balancebalance_due: Balance Duebarcode: Barcodebase_amount: Base Amount@@ -703,6 +710,8 @@ en:categories: Categoriescategorization: Categorizationcategory: Category+ change: Change+ change_password: Change passwordchanges_published: Changes published!channel: Channelcharged: Charged@@ -714,6 +723,8 @@ en:choose_dashboard_locale: Choose Dashboard Localechoose_location: Choose locationcity: City+ clear: Clear+ clear_all: Clear allclear_cache: Clear Cacheclear_cache_ok: Cache was flushedclear_cache_warning: Clearing cache will temporarily reduce the performance of your store.@@ -721,17 +732,21 @@ en:clone: Cloneclose: Closeclose_all_adjustments: Close All Adjustments+ close_sidebar: Close sidebarcode: Code+ colors: Colorscompany: Companycompare_at_amount: Compare at amountcompare_at_price: Compare at pricecomplete: complete+ completed_at: Completed atconditions: Conditionsconfiguration: Configurationconfigurations: Configurationsconfirm: Confirmconfirm_delete: Confirm Deletionconfirm_password: Password Confirmation+ contact: Contactcontact_information: Contact informationcontact_phone: Contact phonecontact_us: Contact us@@ -742,6 +757,7 @@ en:continue_selling_when_out_of_stock: Continue selling when out of stockcontinue_shopping: Continue shoppingcopy_id: Copy+ copy_link: Copy linkcopy_payment_link: Copy payment linkcopy_to_clipboard: Copy to clipboardcost_currency: Cost Currency@@ -775,6 +791,7 @@ en:coupon_code_used: The coupon code you entered has already been used. Please try again.create: Createcreate_a_new_account: Create a new account+ create_account: Create accountcreate_customer: Create customercreate_new: Create newcreate_new_order: Create new order@@ -794,6 +811,7 @@ en:currency: Currencycurrency_settings: Currency Settingscurrent: Current+ current_password: Current passwordcurrent_promotion_usage: 'current usage: %{count}'custom_code: Custom codecustom_font_code: Custom font code@@ -816,6 +834,7 @@ en:date_range: Date Rangedays_ago: Days agodefault: Default+ default_billing_address: Default billing addressdefault_country: Default Countrydefault_country_cannot_be_deleted: Default country cannot be deleteddefault_currency: Default currency@@ -824,16 +843,19 @@ en:news: Newsresources: Resourcesdefault_refund_amount: Default Refund Amount+ default_shipping_address: Default shipping addressdefault_stock_location_name: Shop locationdefault_tax: Default Taxdefault_tax_zone: Default Tax Zonedefault_theme_name: Defaultdefault_wishlist_name: Wishlistdelete: Delete+ delete_address: Delete addressdelete_from_taxon: Delete From Taxondelete_selected: Delete selecteddeleted: Deleteddelivery: Delivery+ delivery_address: Delivery addressdelivery_information: Delivery Informationdepth: Depthdescription: Description@@ -872,6 +894,7 @@ en:duplicate: Duplicateduplicating: Duplicatingedit: Edit+ edit_address: Edit addressedit_refund: Edit refundediting_resource: Editing %{resource}editing_rma_reason: Editing RMA Reason@@ -902,6 +925,8 @@ en:ending_at: Ending atending_in: Ending inends_at: Ends at+ enter: Enter+ enter_using_password: Enter using passworderror: errorerror_user_destroy_with_orders: User associated with orders cannot be destroyederror_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: Expirationexpiration_date: Expiration Date+ explore_taxon: Explore taxonexport: Exportexport_mailer:export_done:@@ -971,6 +997,7 @@ en:finalize: Finalizefinalized: Finalizedfind_a_taxon: Find a Taxon+ find_your_order: Find your orderfirst_item: First Itemfirst_name: First Namefirst_name_begins_with: First Name Begins With@@ -987,6 +1014,7 @@ en:free: Freefree_shipping: Free Shippingfree_shipping_amount: "-"+ from: Fromfront_end: Front Endfulfilled_at: Fulfilled atfulfilled_by: Fulfilled by@@ -998,6 +1026,7 @@ en:general_settings: General Settingsgenerate_code: Generate coupon codeget_back_to_the: Get back to the+ gift_card: Gift cardgift_cards: Gift cardsgo_to_category: Go to categorygo_to_facebook: Go to facebook@@ -1013,9 +1042,11 @@ en:header_font_size_scale: Header font size scaleheight: Heighthelp_center: Help Center+ hide: Hidehide_from_subcategories_nav: Hide from subcategories navigationhome: Homehome_page: homepage+ homepage: Homepagei18n:available_locales: Available Localescountry: Country@@ -1099,6 +1130,7 @@ en:line_item: Line Itemline_item_adjustments: Line item adjustmentsline_items: Line items+ link: Linklist: Listlive: Liveloading: Loading@@ -1158,13 +1190,16 @@ en:must_have_one_store: The resource must belong to a store.mutable: Mutablemy_account: My Account+ my_addresses: My addressesmy_orders: My Ordersname: Namename_on_card: Name on cardname_or_sku: Name or SKU (enter at least first 3 characters of product name)navigation: Navigationnew: New+ new_address: New addressnew_adjustment: New Adjustment+ new_balance: New balancenew_billing_address: New billing addressnew_country: New Countrynew_customer: Create new account@@ -1179,6 +1214,7 @@ en:new_order_completed: New Order Completednew_order_notifications_email: New Order Notifications Emailnew_page: New Page+ new_password: New passwordnew_payment: New Paymentnew_payment_method: New Payment Methodnew_post: New Post@@ -1213,6 +1249,7 @@ en:new_user: New Usernew_variant: New Variantnew_zone: New Zone+ newsletters: Newslettersnext: Nextno_actions_added: No actions addedno_address_given: No address given@@ -1248,6 +1285,7 @@ en:not_found: "%{resource} is not found"not_provided: Not providednot_risky: Not risky+ not_subscribed: Not subscribednote: Notenotice_messages:icon_removed: Image has been successfully removed@@ -1259,11 +1297,13 @@ en:translations_saved: Translations successfully savedvariant_deleted: Variant has been deletedvariant_not_deleted: 'Variant could not be deleted. Reason: %{error}'+ notify_me_when_available: Notify me when availablenum_orders: "# Orders"number: Numberok: OKon_hand: On Handonly_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} leftopen: Openopen_all_adjustments: Open All Adjustmentsoption_name: Option name@@ -1280,6 +1320,7 @@ en:or_select_other_address: or select other addressorder: Orderorder_adjustments: Order adjustments+ order_again: Order againorder_already_updated: The order has already been updated.order_approved: Order approvedorder_canceled: Order canceled@@ -1326,6 +1367,7 @@ en:payment: paymentresumed: resumedreturned: returned+ order_status: Order statusorder_success: Order placed successfullyorder_success_explain: Your order information will be sent to your emailorder_summary: Order Summary@@ -1334,6 +1376,7 @@ en:order_updated: Order Updatedorders: Ordersorigin: Origin+ other: Otherout_of_stock: Out of Stockoverview: Overviewpackage_from: package from@@ -1435,11 +1478,15 @@ en:percent: Percentpercent_per_item: Percent Per Itempermalink: Permalink+ personal_details: Personal detailsphone: Phone+ place_now: Place nowplace_order: Place Orderplease_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 optionspolicies: Policiespopulate_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 groupmanual: Manually choose+ product_sold_out: This item is sold outproducts: Productsproducts_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: Relevancepromotion: Promotionpromotion_action: Promotion Actionpromotion_action_types:@@ -1555,6 +1613,8 @@ en:query: Queryquick_search: Quick search..rate: Rate+ read_less: Read less+ read_more: Read morereason: Reasonreceive: receivereceive_stock: Receive Stock@@ -1569,6 +1629,7 @@ en:refunds: Refundsregister: Registerregistration: Registration+ regular_price: Regular pricereimburse: Reimbursereimbursed: Reimbursedreimbursement: Reimbursement@@ -1649,6 +1710,8 @@ en:roles: Rolesrules: Rulessafe: Safe+ sale: Sale+ sale_price: Sale pricesales_total: Sales Totalsales_total_description: Sales Total For All Orderssales_totals: Sales Totals@@ -1662,6 +1725,7 @@ en:scope: Scopescopes: Scopessearch: Search+ search_all: Search allsearch_by: 'Search by:'search_engine_listing: Search engine listingsearch_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 Tosend_mails_as: Send Mails As+ send_message: Send messagesend_payment_link: Send payment linksend_payment_link_title: Send payment link title+ send_us_a_message: Send us a messageseo: SEOseo_robots: SEO Robotsseo_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 Stateshipment_states:backorder: Backorder@@ -1730,6 +1797,7 @@ en:shipment_transfer_success: Variants successfully transferredshipments: Shipmentsshipped: Shipped+ shipped_from: Shipped fromshipping: Shippingshipping_address: Shipping Addressshipping_categories: Shipping Categories@@ -1740,6 +1808,7 @@ en:shipping_instructions: Shipping Instructionsshipping_method: Shipping Methodshipping_methods: Shipping Methods+ shipping_not_available: Shipping not availableshipping_policy: Shipping Policyshipping_price_sack: Price sackshipping_rates:@@ -1753,9 +1822,11 @@ en:shopping_cart: Shopping Cartshow: Showshow_active: Show Active+ show_all: Show allshow_deleted: Show Deletedshow_details: Show detailsshow_discontinued: Show Discontinued+ show_less: Show lessshow_only_complete_orders: Only show complete ordersshow_only_considered_risky: Only show risky ordersshow_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 Currencyshort: Show Store selector+ sign_out: Sign outsign_up: Sign Upsite_name: Site namesize: Size@@ -1772,7 +1844,9 @@ en:slug: Slugsocial: Socialsocial_media: Social media+ sold_out: Sold outsomething_went_wrong: Something went wrong+ sort_by: Sort bysource: Sourcespecial_instructions: Special Instructionssplit: Split@@ -1895,10 +1969,10 @@ en:store_not_set_as_default: Couldn't set store %{store} as a default storestore_set_as_default: Store %{store} is now a default storestore_set_default_button: Set as default- storefront: Storefrontstores: Storesstreet_address: Street Addressstreet_address_2: Street Address (cont'd)+ subscribed: Subscribedsubtotal: Subtotalsubtract: Subtractsuccess: Success@@ -1981,12 +2055,15 @@ en:title: Titletitle_link: Title linkto_add_variants_you_must_first_define: To add variants, you must first define+ toggle_menu: Toggle menu+ top_suggestions: Top suggestionstotal: Totaltotal_per_item: Total per itemtotal_pre_tax_refund: Total Pre-Tax Refundtotal_price: Total pricetotal_sales: Total Salestrack_inventory: Track Inventory+ track_items: Track itemstrack_quantity: Track quantitytracking: Trackingtracking_number: Tracking Number@@ -2056,6 +2133,8 @@ en:vendors: Vendorsversion: Versionview: View+ view_all: View all+ view_full_details: View full detailsview_store: View storeview_your_store: View your storevisibility: 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: Wishlistwithout_taxon: Without taxonyear: Yearyou_have_no_orders_yet: You have no orders yetdiff --git a/storefront/app/controllers/spree/addresses_controller.rb b/storefront/app/controllers/spree/addresses_controller.rbindex 52d787516b..07fb0d601c 100644--- a/storefront/app/controllers/spree/addresses_controller.rb+++ b/storefront/app/controllers/spree/addresses_controller.rb@@ -24,7 +24,7 @@ module Spreeendendelse- 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')endelserender action: 'new', status: :unprocessable_entity@@ -57,7 +57,7 @@ module Spree@address = result.valueif 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 Spreedef 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'))endprivatediff --git a/storefront/app/controllers/spree/contacts_controller.rb b/storefront/app/controllers/spree/contacts_controller.rbindex 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 = requestif @contact.deliver- flash[:success] = 'Message sent!'+ flash[:success] = Spree.t('storefront.contacts.message_sent')elsemessage_not_sentend@@ -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')enddef ensure_customer_support_emailreturn 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_pathendenddiff --git a/storefront/app/views/spree/addresses/edit.html.erb b/storefront/app/views/spree/addresses/edit.html.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.erbindex 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.ymlnew file mode 100644index 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.ymlindex 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 bagcheckout:- 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 stepcontinue_to_cart: Continue to cartcontinue_to_checkout: Continue to checkoutdelivery_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 wishlistno_wished_items:- title: You have no Saved Itemsdescription: 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: Unavailablediff --git a/storefront/spec/controllers/spree/addresses_controller_spec.rb b/storefront/spec/controllers/spree/addresses_controller_spec.rbindex 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 doit 'sets flash message' dopost_create- expect(flash[:notice]).to eq Spree.t(:successfully_created, scope: :address_book)+ expect(flash[:notice]).to eq Spree.t('address_book.successfully_created')endcontext 'default address' do@@ -127,7 +127,7 @@ describe Spree::AddressesController, type: :controller doit 'sets flash message' doput_update- expect(flash[:notice]).to eq Spree.t(:successfully_updated, scope: :address_book)+ expect(flash[:notice]).to eq Spree.t('address_book.successfully_updated')endit 'returns 302 status code' do@@ -180,7 +180,7 @@ describe Spree::AddressesController, type: :controller doit 'sets flash message' doput_update- expect(flash[:notice]).to eq Spree.t(:successfully_updated, scope: :address_book)+ expect(flash[:notice]).to eq Spree.t('address_book.successfully_updated')endit 'returns 302 status code' dodiff --git a/storefront/spec/i18n_spec.rb b/storefront/spec/i18n_spec.rbnew file mode 100644index 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