Skip to content

Commit

Permalink
Keep translations for the admin dashboard toggle in core
Browse files Browse the repository at this point in the history
Backend should not depend on solidus_admin.
  • Loading branch information
elia committed Sep 29, 2023
1 parent 9fd6307 commit 1288f9c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="mt-auto">
<div class="group mb-3">
<label class="flex gap-3 items-center py-0.5 px-3 pb-0.5 rounded hover:text-red-500 hover:bg-gray-50 body-small-bold text-black cursor-pointer">
<%= t('solidus_admin.main_nav.legacy_label') %>
<%= t('spree.navigation.switch_to_legacy') %>
<div class="flex items-center">
<%= render component("ui/forms/switch").new(size: :s, checked: false, 'data-action': "#{stimulus_id}#setCookie:prevent") %>
</div>
Expand Down
2 changes: 0 additions & 2 deletions admin/config/locales/main_nav.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ en:
stock: Stock
users: Users
settings: Settings
legacy_label: Switch to legacy admin
admin_label: Switch to new admin
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<span
id="solidus-admin-switch-label"
class="text"
data-legacy-label="<%= 'solidus_admin.main_nav.legacy_label'.then { t(_1, default: t(_1, locale: :en)) } %>"
data-admin-label="<%= 'solidus_admin.main_nav.admin_label'.then { t(_1, default: t(_1, locale: :en)) } %>"
data-legacy-label="<%= 'spree.navigation.switch_to_legacy'.then { t(_1, default: t(_1, locale: :en)) } %>"
data-admin-label="<%= 'spree.navigation.switch_to_solidus_admin'.then { t(_1, default: t(_1, locale: :en)) } %>"
></span>
<span><input type="checkbox" id="solidus-admin-switch" class="solidus-admin--nav--switch"/></span>
</label>
Expand Down
3 changes: 3 additions & 0 deletions core/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,9 @@ en:
name_contains: Name Contains
name_on_card: Name on card
name_or_sku: Name or SKU (enter at least first 4 characters of product name)
navigation:
switch_to_legacy: Switch to legacy admin
switch_to_solidus_admin: Switch to new admin
negative_movement_absent_item: Cannot create negative movement for absent stock item.
new: New
new_adjustment: New Adjustment
Expand Down

0 comments on commit 1288f9c

Please sign in to comment.