Skip to content

Commit e99f2e9

Browse files
committed
Localization and missing strings
1 parent b2b3f2e commit e99f2e9

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

admin/app/components/solidus_admin/orders/index/component.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def state_column
124124
'canceled' => :blue,
125125
'cart' => :graphite_light,
126126
}[order.state] || :yellow
127-
component('ui/badge').new(name: order.state.humanize, color:)
127+
component('ui/badge').new(name: I18n.t("spree.order_state.#{order.state}").humanize, color:)
128128
end
129129
}
130130
end
@@ -171,7 +171,7 @@ def payment_column
171171
{
172172
header: :payment,
173173
data: ->(order) do
174-
component('ui/badge').new(name: order.payment_state.humanize, color: order.paid? ? :green : :yellow) if order.payment_state?
174+
component('ui/badge').new(name: I18n.t("spree.payment_states.#{order.payment_state}").humanize, color: order.paid? ? :green : :yellow) if order.payment_state?
175175
end
176176
}
177177
end
@@ -180,7 +180,7 @@ def shipment_column
180180
{
181181
header: :shipment,
182182
data: ->(order) do
183-
component('ui/badge').new(name: order.shipment_state.humanize, color: order.shipped? ? :green : :yellow) if order.shipment_state?
183+
component('ui/badge').new(name: I18n.t("spree.shipment_states.#{order.shipment_state}").humanize, color: order.shipped? ? :green : :yellow) if order.shipment_state?
184184
end
185185
}
186186
end

admin/app/components/solidus_admin/ui/pages/index/component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def renderable_tabs
3535
end
3636

3737
def title
38-
model_class.model_name.human.pluralize
38+
I18n.t("activerecord.models.#{model_class.model_name.i18n_key}", count: 2)
3939
end
4040

4141
def search_params
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
en:
22
solidus_admin:
33
menu_item:
4+
checkout: Refunds and Returns
5+
display_order: Display order
6+
option_types: Option Types
47
orders: Orders
8+
payments: Payments
59
products: Products
6-
option_types: Option Types
7-
property_types: Properties
8-
taxonomies: Taxonomies
9-
promotions: Promotions
1010
promotion_categories: Promotion Categories
11-
stock: Stock
12-
users: Users
11+
promotions: Promotions
12+
properties: Properties
1313
settings: Settings
14+
shipping: Shipping
15+
stock: Stock
1416
stores: Stores
1517
taxes: Taxes
16-
checkout: Refunds and Returns
17-
shipping: Shipping
18+
taxonomies: Taxonomies
19+
users: Users
1820
zones: Zones

0 commit comments

Comments
 (0)