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.

Add missing translations.

Matthew Kennedye7f9e97de97a
diff --git a/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss b/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
index e7445aca43..6df9de34fe 100644
--- a/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
+++ b/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
@@ -55,11 +55,10 @@
}
.edge {
- padding-left: 0;
- padding-right: 0;
+ padding-left: 0;
+ padding-right: 0;
+
div.row {
- border-left: none !important;
- border-right: none !important;
}
}
diff --git a/backend/app/helpers/spree/admin/base_helper.rb b/backend/app/helpers/spree/admin/base_helper.rb
index 421f8f999a..b1f382d0a6 100644
--- a/backend/app/helpers/spree/admin/base_helper.rb
+++ b/backend/app/helpers/spree/admin/base_helper.rb
@@ -61,27 +61,6 @@ module Spree
formatted_option_values
end
- # Returns Custom Dropdown Values
- # Pass the object as the first argument, and then a hash of options as a second arguments.
- # text: returns the visable text in the dropdown option, and value: defaults to id but can be overidden.
- # Example:
- #
- # spree_custom_dropdown_values(@store, { text: 'unique_name' })
- # spree_custom_dropdown_values(@store, { text: 'unique_name', value: 'name' })
- #
- def spree_custom_dropdown_values(object, options = {})
- formatted_option_values = []
-
- text = options[:text] || nil
- value = options[:value] || 'id'
-
- return unless text.present?
-
- object.map { |obj| formatted_option_values << [obj.send(text), obj.send(value)] }
-
- formatted_option_values
- end
-
def spree_humanize_type(obj)
last_word = obj.split('::', 10).last
diff --git a/backend/app/helpers/spree/admin/cms_helper.rb b/backend/app/helpers/spree/admin/cms_helper.rb
index 4e22592b4e..61c4cf0a6f 100644
--- a/backend/app/helpers/spree/admin/cms_helper.rb
+++ b/backend/app/helpers/spree/admin/cms_helper.rb
@@ -32,7 +32,7 @@ module Spree
end
button_link_to(
- Spree.t(:preview_page),
+ Spree.t('admin.cms.preview_page'),
url,
class: 'btn-outline-secondary', icon: 'view.svg', id: 'admin_preview_product', target: :blank
)
diff --git a/backend/app/views/spree/admin/cms_pages/_form.html.erb b/backend/app/views/spree/admin/cms_pages/_form.html.erb
index 50d99909ae..3eed64e169 100644
--- a/backend/app/views/spree/admin/cms_pages/_form.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/_form.html.erb
@@ -29,7 +29,7 @@
<div class="row pb-0">
<%= f.field_container :title, class: ['form-group col-6'] do %>
- <%= f.label :title, raw(Spree.t('admin.cms.page_title') + required_span_tag) %>
+ <%= f.label :title, raw(Spree.t('admin.cms.title') + required_span_tag) %>
<%= f.text_field :title, class: 'form-control', required: true %>
<%= f.error_message_on :title %>
<% end %>
@@ -48,7 +48,7 @@
<%= f.field_container :slug, class: ['form-group col-6'] do %>
<div id="noHomePage">
- <%= f.label :slug, Spree.t('admin.pages.slug') %>
+ <%= f.label :slug, Spree.t('slug') %>
<%= f.text_field :slug, class: 'form-control' %>
<%= f.error_message_on :slug %>
</div>
@@ -57,7 +57,7 @@
<%= f.field_container :visible, class: ['form-group col-6'] do %>
<div class="custom-control custom-checkbox">
<%= f.check_box :visible, class: 'custom-control-input' %>
- <%= f.label :visible, Spree.t(:visible), class: 'custom-control-label' %>
+ <%= f.label :visible, Spree.t('admin.cms.visible'), class: 'custom-control-label' %>
<%= f.error_message_on :visible %>
</div>
<% end %>
@@ -73,13 +73,13 @@
<h5 class="mt-4"><%= Spree.t('admin.cms.seo_settings') %></h5>
<div class="row pb-0">
<%= f.field_container :meta_title, class: ['form-group col-12'] do %>
- <%= f.label :meta_title, Spree.t('admin.pages.meta_title') %>
+ <%= f.label :meta_title, Spree.t('admin.cms.meta_title') %>
<%= f.text_field :meta_title, class: 'form-control' %>
<%= f.error_message_on :meta_title %>
<% end %>
<%= f.field_container :meta_description, class: ['form-group col-12'] do %>
- <%= f.label :meta_description, Spree.t('admin.pages.meta_description') %>
+ <%= f.label :meta_description, Spree.t('admin.cms.meta_description') %>
<%= f.text_area :meta_description, { rows: 3, class: 'form-control' } %>
<%= f.error_message_on :meta_description %>
<% end %>
@@ -107,7 +107,6 @@
<div class="row">
<div class="col-12">
<%= f.field_container :content, class: ['form-group'] do %>
- <%= f.label :content, Spree.t(:content) %>
<%= f.text_area :content, { rows: 26, class: 'spree-rte'} %>
<%= f.error_message_on :content %>
<% end %>
diff --git a/backend/app/views/spree/admin/cms_pages/_section_template.html.erb b/backend/app/views/spree/admin/cms_pages/_section_template.html.erb
index 500100634f..d7a402f8e0 100644
--- a/backend/app/views/spree/admin/cms_pages/_section_template.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/_section_template.html.erb
@@ -7,7 +7,7 @@
<% if section.full_width_on_small %>
<small class="form-text mt-1">
<%= svg_icon name: "mobile.svg", width: '23', height: '23' %>
- Full-width
+ <%= Spree.t('admin.cms.full_width') %>
</small>
<% end %>
</div>
diff --git a/backend/app/views/spree/admin/cms_pages/edit.html.erb b/backend/app/views/spree/admin/cms_pages/edit.html.erb
index 10bf3b51b9..cda3df1ac1 100644
--- a/backend/app/views/spree/admin/cms_pages/edit.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/edit.html.erb
@@ -1,5 +1,5 @@
<% content_for :page_title do %>
- <%= link_to Spree.t('admin.navigation.all_pages'), spree.admin_cms_pages_path %> / <%= @cms_page.title %>
+ <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> / <%= @cms_page.title %>
<% end %>
<% content_for :page_actions do %>
@@ -17,7 +17,7 @@
<hr class="mt-5 hide-on-full-screen-mode">
<div class="row">
<div class="col d-flex justify-content-start">
- <%= button_link_to Spree.t('admin.pages.add_new_section'), spree.new_admin_cms_page_cms_section_path(@cms_page), icon: 'add.svg', class: 'no-wrap btn btn-success align-self-center' %>
+ <%= button_link_to Spree.t('admin.cms.add_new_section'), spree.new_admin_cms_page_cms_section_path(@cms_page), icon: 'add.svg', class: 'no-wrap btn btn-success align-self-center' %>
</div>
<div class="col d-flex justify-content-end">
<div id="LiveViewSwitcher" class="btn-group btn-group-toggle" data-toggle="buttons">
diff --git a/backend/app/views/spree/admin/cms_pages/index.html.erb b/backend/app/views/spree/admin/cms_pages/index.html.erb
index f072c3cd5c..ceccb1c17d 100644
--- a/backend/app/views/spree/admin/cms_pages/index.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/index.html.erb
@@ -1,18 +1,18 @@
<% content_for :page_title do %>
- <%= Spree.t('admin.pages.pages') %>
+ <%= Spree.t('admin.cms.all_pages') %>
<% end %>
<% content_for :page_actions do %>
- <%= button_link_to Spree.t('admin.pages.add_new_page'), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_page' } %>
+ <%= button_link_to Spree.t('admin.cms.add_new_page'), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_page' } %>
<% end if can?(:create, Spree::CmsPage) %>
<% if @cms_pages.any? %>
<div class="table-responsive">
<table class="table" id="pagesTable">
<thead>
- <th scope="col"><%= Spree.t(:title) %></th>
+ <th scope="col"><%= Spree.t('admin.cms.title') %></th>
<th scope="col"><%= Spree.t(:draft_mode) %></th>
- <th scope="col"><%= Spree.t('admin.pages.page_type') %></th>
+ <th scope="col"><%= Spree.t('admin.cms.page_type') %></th>
<th scope="col"><%= Spree.t('store') %></th>
<th scope="col"><%= Spree.t('language') %></th>
<th scope="col"></th>
@@ -48,6 +48,6 @@
</div>
<% else %>
<div class="alert alert-info no-objects-found">
- <%= Spree.t('admin.page.you_have_no_pages') %>
+ <%= Spree.t('admin.cms.you_have_no_pages') %>
</div>
<% end %>
diff --git a/backend/app/views/spree/admin/cms_pages/new.html.erb b/backend/app/views/spree/admin/cms_pages/new.html.erb
index 374e893db2..a21b82dd47 100644
--- a/backend/app/views/spree/admin/cms_pages/new.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/new.html.erb
@@ -1,5 +1,5 @@
<% content_for :page_title do %>
- <%= link_to Spree.t('admin.pages.all_pages'), spree.admin_cms_pages_path %> / <%= Spree.t('admin.pages.new_page') %>
+ <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> / <%= Spree.t('admin.cms.new_page') %>
<% end %>
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_page } %>
diff --git a/backend/app/views/spree/admin/menus/index.html.erb b/backend/app/views/spree/admin/menus/index.html.erb
index 5bae51108a..ad83abed6c 100644
--- a/backend/app/views/spree/admin/menus/index.html.erb
+++ b/backend/app/views/spree/admin/menus/index.html.erb
@@ -35,7 +35,7 @@
<div class="col-12 col-lg-6">
<div class="form-group">
<%= label_tag :q_store_id_in, Spree.t(:store) %>
- <%= f.select :store_id_in, spree_custom_dropdown_values(@stores, { text: 'unique_name' }), { include_blank: true }, class: 'select2-clear js-filterable' %>
+ <%= f.collection_select(:store_id_in, @stores, :id, :unique_name, { include_blank: true }, { class: 'select2-clear js-filterable' }) %>
</div>
</div>
</div>
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index 02afb2de0e..e9a6c00021 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -550,6 +550,20 @@ en:
adjustments: Adjustments
admin:
cms:
+ all_pages: All Pages
+ add_new_page: Add New Page
+ add_new_section: Add New Section
+ content: Content
+ draft_mode: Draft Mode
+ full_width: Full width
+ title: Title
+ page_type: Page Type
+ you_have_no_pages: You have no pages, click the Add New Page button to get started.
+ new_page: New Page
+ visible: Visible
+ meta_title: Meta Title
+ meta_description: Meta Description
+ preview_page: Preview Page
hero:
aspect_ratio: Please use an image with the aspext ratio of 12:5 (2400px x 1000px)
select_page_type: Select a page type
diff --git a/frontend/app/views/spree/shared/cms/pages/_edit_mode.html.erb b/frontend/app/views/spree/shared/cms/pages/_edit_mode.html.erb
index 1d9ed81c63..ef9e61cf04 100644
--- a/frontend/app/views/spree/shared/cms/pages/_edit_mode.html.erb
+++ b/frontend/app/views/spree/shared/cms/pages/_edit_mode.html.erb
@@ -4,7 +4,7 @@
<div id="draftNotice" class="col-12 d-flex w-100 p-4 justify-content-center align-items-center bg-dark">
<span class="text-white">
<h5 class="mb-0">
- <%= Spree.t('spree_pages.draft_mode') %>
+ <%= Spree.t('draft_mode') %>
</h5>
</span>
</div>