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 RTL support for rails admin

Damian Legawiec56491b5daa23
diff --git a/scripts/docker-compose.edge.yml b/scripts/docker-compose.edge.yml
index 48d43f4035..abae42b420 100644
--- a/scripts/docker-compose.edge.yml
+++ b/scripts/docker-compose.edge.yml
@@ -41,7 +41,7 @@ services:
command:
[
"sh", "-c",
- "(bundle check || bundle install) && bin/rails spree:install:migrations db:prepare && exec bin/rails server -b 0.0.0.0 -p 3000"
+ "(bundle check || bundle install) && bin/rails spree:install:migrations db:prepare && bin/rails spree:admin:tailwindcss:build && exec bin/rails server -b 0.0.0.0 -p 3000"
]
worker:
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_alerts.css b/spree/admin/app/assets/tailwind/spree/admin/components/_alerts.css
index 66baa2a84e..a03a54a10e 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_alerts.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_alerts.css
@@ -4,11 +4,15 @@
@layer components {
.alert {
- @apply inline-flex flex-col justify-center relative bg-no-repeat py-3 px-4 pl-11 mb-4 min-h-10 border border-transparent rounded-lg;
+ @apply inline-flex flex-col justify-center relative bg-no-repeat py-3 px-4 ps-11 mb-4 min-h-10 border border-transparent rounded-lg;
background-position: 1rem center;
background-size: 1rem 1rem;
}
+ [dir="rtl"] .alert {
+ background-position: right 1rem center;
+ }
+
.alert > p:last-child {
@apply mb-0;
}
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_badges.css b/spree/admin/app/assets/tailwind/spree/admin/components/_badges.css
index cc7bd8a080..8550774566 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_badges.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_badges.css
@@ -8,7 +8,7 @@
}
.badge i {
- @apply mr-1 text-[100%];
+ @apply me-1 text-[100%];
}
.badge .ti {
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_breadcrumbs.css b/spree/admin/app/assets/tailwind/spree/admin/components/_breadcrumbs.css
index c99272a450..474f4bd5d0 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_breadcrumbs.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_breadcrumbs.css
@@ -5,7 +5,7 @@
@layer components {
.breadcrumb {
@apply flex flex-wrap items-center mb-0 list-none font-medium bg-transparent rounded-none;
- @apply gap-2 p-0 pl-4 h-8 border-l border-gray-100;
+ @apply gap-2 p-0 ps-4 h-8 border-s border-gray-100;
}
.breadcrumb li a {
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_buttons.css b/spree/admin/app/assets/tailwind/spree/admin/components/_buttons.css
index 17102c02aa..3b80ede936 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_buttons.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_buttons.css
@@ -109,6 +109,6 @@
}
.actions .btn {
- @apply ml-1;
+ @apply ms-1;
}
}
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css b/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css
index 9b86995fe0..c463efaccf 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css
@@ -127,7 +127,7 @@
}
.card-link + .card-link {
- @apply ml-3;
+ @apply ms-3;
}
.card-img-top {
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_dialogs.css b/spree/admin/app/assets/tailwind/spree/admin/components/_dialogs.css
index 2fb58412b1..72d6239402 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_dialogs.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_dialogs.css
@@ -69,7 +69,9 @@
========================================================================== */
.drawer {
- @apply fixed top-0 right-0 left-auto flex-col justify-between p-0 overflow-hidden;
+ @apply fixed top-0 flex-col justify-between p-0 overflow-hidden;
+ inset-inline-end: 0;
+ inset-inline-start: auto;
height: calc(100dvh - 1rem);
max-height: calc(100dvh - 1rem);
width: calc(100vw - 1rem);
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_dropdowns.css b/spree/admin/app/assets/tailwind/spree/admin/components/_dropdowns.css
index da2aaedcb6..446a926a4d 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_dropdowns.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_dropdowns.css
@@ -73,11 +73,11 @@
.dropdown-item {
@apply flex items-center justify-start w-full clear-both text-inherit no-underline whitespace-nowrap bg-transparent border-0 font-normal;
- @apply h-8 mb-1 pr-8 rounded-xl transition-colors duration-75 ease-linear gap-3;
+ @apply h-8 mb-1 pe-8 rounded-xl transition-colors duration-75 ease-linear gap-3;
}
.dropdown-item .badge {
- @apply ml-auto self-center;
+ @apply ms-auto self-center;
}
.dropdown-item:hover,
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_filters.css b/spree/admin/app/assets/tailwind/spree/admin/components/_filters.css
index 6529db79dc..a91a904118 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_filters.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_filters.css
@@ -17,7 +17,7 @@
#table-filter {
- @apply absolute p-4 rounded-2xl shadow-dropdown bg-white mt-2 right-2 w-full overflow-y-auto;
+ @apply absolute p-4 rounded-2xl shadow-dropdown bg-white mt-2 end-2 w-full overflow-y-auto;
animation: fadeIn 0.2s ease-in-out;
z-index: 1050;
max-height: calc(100vh - var(--spacing-header-height) - 4rem);
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_forms.css b/spree/admin/app/assets/tailwind/spree/admin/components/_forms.css
index 0239d990e9..70d258be10 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_forms.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_forms.css
@@ -124,11 +124,11 @@
}
.custom-control-label {
- @apply relative mb-0 align-top cursor-pointer select-none pl-7 font-normal;
+ @apply relative mb-0 align-top cursor-pointer select-none ps-7 font-normal;
}
.custom-control-label::before {
- @apply absolute left-0 top-0.5 block pointer-events-none bg-white border border-gray-300 rounded;
+ @apply absolute start-0 top-0.5 block pointer-events-none bg-white border border-gray-300 rounded;
content: "";
width: 1.125rem;
height: 1.125rem;
@@ -139,7 +139,7 @@
}
.custom-control-label::after {
- @apply absolute left-0 top-0.5 block bg-no-repeat bg-center;
+ @apply absolute start-0 top-0.5 block bg-no-repeat bg-center;
content: "";
width: 1.125rem;
height: 1.125rem;
@@ -207,18 +207,18 @@
/* Custom switch styles */
.custom-switch {
- @apply pl-12;
+ @apply ps-12;
}
.custom-switch .custom-control-label::before {
- @apply left-0 rounded-full bg-gray-200 border-gray-200;
+ @apply start-0 rounded-full bg-gray-200 border-gray-200;
width: 2.5rem;
height: 1.25rem;
pointer-events: all;
}
.custom-switch .custom-control-label::after {
- @apply left-0.5 top-1 rounded-full bg-white shadow;
+ @apply start-0.5 top-1 rounded-full bg-white shadow;
width: 1rem;
height: 1rem;
transition:
@@ -235,6 +235,10 @@
transform: translateX(1.25rem);
}
+ [dir="rtl"] .custom-switch .custom-control-input:checked ~ .custom-control-label::after {
+ transform: translateX(-1.25rem);
+ }
+
.custom-switch .custom-control-input:focus ~ .custom-control-label::before {
@apply ring-2 ring-blue-500/25 ring-offset-1;
}
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_layout.css b/spree/admin/app/assets/tailwind/spree/admin/components/_layout.css
index fbd13c6171..66eb7def8e 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_layout.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_layout.css
@@ -8,17 +8,17 @@
height: var(--spacing-header-height);
background-color: var(--color-white);
box-shadow: inset 0 -1px 0 var(--color-gray-200);
- transition: margin-left 0.1s ease;
+ transition: margin-inline-start 0.1s ease;
}
@media (min-width: 992px) {
#header {
- margin-left: var(--spacing-sidebar-width);
+ margin-inline-start: var(--spacing-sidebar-width);
}
}
body.sidebar-collapsed #header {
- margin-left: var(--spacing-sidebar-collapsed);
+ margin-inline-start: var(--spacing-sidebar-collapsed);
}
#page-header {
@@ -48,17 +48,17 @@
#settings-header {
@apply sticky top-0 flex items-center p-0 bg-white z-1000;
height: var(--spacing-header-height);
- transition: margin-left 0.1s ease;
+ transition: margin-inline-start 0.1s ease;
}
@media (min-width: 992px) {
#settings-header {
- margin-left: var(--spacing-sidebar-width);
+ margin-inline-start: var(--spacing-sidebar-width);
}
}
body.sidebar-collapsed #settings-header {
- margin-left: var(--spacing-sidebar-collapsed);
+ margin-inline-start: var(--spacing-sidebar-collapsed);
}
#settings-header #page-header {
@@ -93,18 +93,18 @@
/* Main Content */
#content {
- transition: margin-left 0.1s ease;
+ transition: margin-inline-start 0.1s ease;
}
@media (min-width: 992px) {
#content {
- margin-left: calc(var(--spacing-sidebar-width) + 1px);
+ margin-inline-start: calc(var(--spacing-sidebar-width) + 1px);
}
}
/* Store Dropdown */
.store-dropdown {
- @apply flex items-center justify-between pr-3 pl-2 mr-px;
+ @apply flex items-center justify-between pe-3 ps-2 me-px;
transition: padding 0.1s ease;
height: var(--spacing-header-height);
}
@@ -131,7 +131,7 @@
/* User Dropdown */
.user-dropdown {
- @apply hidden items-center justify-between p-2 bg-gray-25 border-t border-gray-200 mt-auto mr-px;
+ @apply hidden items-center justify-between p-2 bg-gray-25 border-t border-gray-200 mt-auto me-px;
}
@media (min-width: 992px) {
@@ -175,7 +175,8 @@
#main-sidebar {
@apply flex flex-col gap-0 bg-gray-25 h-screen overflow-x-hidden fixed top-0;
width: var(--spacing-sidebar-width);
- box-shadow: inset -1px 0 0 var(--color-gray-200);
+ inset-inline-start: 0;
+ border-inline-end: 1px solid var(--color-gray-200);
}
@media (max-width: 992px) {
@@ -198,7 +199,7 @@
}
#main-sidebar .nav-link .ti {
- @apply mr-2 rounded-lg shrink-0 text-gray-400 transition-colors duration-200 ease-in-out;
+ @apply me-2 rounded-lg shrink-0 text-gray-400 transition-colors duration-200 ease-in-out;
padding: 0.2rem;
}
@@ -224,11 +225,11 @@
}
#main-sidebar .nav-submenu {
- @apply flex flex-col list-none pt-1 pl-8 relative;
+ @apply flex flex-col list-none pt-1 ps-8 relative;
}
#main-sidebar .nav-submenu:before {
- @apply absolute bg-gray-200 left-4 top-0 bottom-1;
+ @apply absolute bg-gray-200 start-4 top-0 bottom-1;
content: '';
width: 1px;
}
@@ -252,7 +253,7 @@
#main-sidebar .nav-submenu .nav-link:focus:before {
@apply absolute bg-zinc-950 rounded-sm;
content: '';
- left: calc(-1rem - 1px);
+ inset-inline-start: calc(-1rem - 1px);
top: 10%;
width: 3px;
height: 80%;
@@ -309,7 +310,7 @@
}
body.sidebar-collapsed #main-sidebar .sidebar-content .nav > .nav-item > .nav-link .badge {
- @apply flex absolute top-0 right-0 justify-center items-center text-2xs px-1 py-0 rounded-full;
+ @apply flex absolute top-0 end-0 justify-center items-center text-2xs px-1 py-0 rounded-full;
transform: translate(25%, -25%);
min-width: 18px;
height: 18px;
@@ -414,7 +415,7 @@
}
body.sidebar-collapsed #content {
- margin-left: calc(var(--spacing-sidebar-collapsed) + 1px);
+ margin-inline-start: calc(var(--spacing-sidebar-collapsed) + 1px);
}
/* Mobile Sidebar */
@@ -427,8 +428,14 @@
}
.sidebar-mobile .sidebar-panel {
- @apply absolute left-0 top-0 bottom-0 bg-gray-25 overflow-y-auto flex flex-col shadow-lg transition-transform duration-500 -translate-x-full;
+ @apply absolute top-0 bottom-0 bg-gray-25 overflow-y-auto flex flex-col shadow-lg transition-transform duration-500;
+ inset-inline-start: 0;
width: var(--spacing-sidebar-width);
+ transform: translateX(-100%);
+ }
+
+ [dir="rtl"] .sidebar-mobile .sidebar-panel {
+ transform: translateX(100%);
}
.sidebar-mobile .sidebar-mobile-header {
@@ -459,7 +466,7 @@
}
.sidebar-mobile .sidebar-mobile-content .nav-link .ti {
- @apply mr-2 rounded-lg shrink-0;
+ @apply me-2 rounded-lg shrink-0;
padding: 0.2rem;
}
@@ -485,11 +492,11 @@
}
.sidebar-mobile .sidebar-mobile-content .nav-submenu {
- @apply flex flex-col list-none pt-1 pl-8 relative;
+ @apply flex flex-col list-none pt-1 ps-8 relative;
}
.sidebar-mobile .sidebar-mobile-content .nav-submenu:before {
- @apply absolute bg-gray-200 left-4 top-0 bottom-1;
+ @apply absolute bg-gray-200 start-4 top-0 bottom-1;
content: '';
width: 1px;
}
@@ -513,7 +520,7 @@
.sidebar-mobile .sidebar-mobile-content .nav-submenu .nav-link:focus:before {
@apply absolute bg-zinc-950 rounded-sm;
content: '';
- left: calc(-1rem - 1px);
+ inset-inline-start: calc(-1rem - 1px);
top: 10%;
width: 3px;
height: 80%;
@@ -565,7 +572,7 @@
}
#enterprise-edition-notice .btn-close {
- @apply absolute right-1 top-1 text-inherit!;
+ @apply absolute end-1 top-1 text-inherit!;
}
#enterprise-edition-notice .btn-close:hover {
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_rtl.css b/spree/admin/app/assets/tailwind/spree/admin/components/_rtl.css
new file mode 100644
index 0000000000..4cf98f4b88
--- /dev/null
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_rtl.css
@@ -0,0 +1,53 @@
+/* ==========================================================================
+ RTL — direction-specific rules that logical properties can't express.
+
+ Layout/spacing flips are handled in the base component CSS via logical
+ utilities (ms-/me-/ps-/pe-/start-/end-/border-s/border-e) and logical
+ properties (margin-inline-start, inset-inline-start, …), which mirror
+ automatically under <html dir="rtl">. Only transforms, keyframe
+ animations, background positions, and the script font remain here.
+ ========================================================================== */
+
+@layer components {
+ /* Arabic-capable typeface for RTL locales */
+ [dir="rtl"] body.admin {
+ font-family: "Noto Sans Arabic", "Geist", ui-sans-serif, system-ui, sans-serif;
+ }
+
+ /* Sidebar collapse chevron — rotation is a transform, not a logical prop */
+ [dir="rtl"] body.sidebar-collapsed .sidebar-toggle-btn {
+ transform: rotate(0deg);
+ }
+
+ /* Collapsed nav badge — translate must flip horizontally */
+ [dir="rtl"] body.sidebar-collapsed #main-sidebar .sidebar-content .nav > .nav-item > .nav-link .badge {
+ transform: translate(-25%, -25%);
+ }
+
+ /* Drawer slides from the inline-start edge in RTL */
+ [dir="rtl"] .drawer[open] {
+ animation: slideInLeft 0.25s ease-out forwards;
+ }
+
+ [dir="rtl"] dialog.drawer[closing] {
+ animation: slideOutLeft 0.2s ease-in forwards;
+ }
+
+ @keyframes slideInLeft {
+ from {
+ transform: translateX(-100%);
+ }
+ to {
+ transform: translateX(0);
+ }
+ }
+
+ @keyframes slideOutLeft {
+ from {
+ transform: translateX(0);
+ }
+ to {
+ transform: translateX(-100%);
+ }
+ }
+}
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_search-picker.css b/spree/admin/app/assets/tailwind/spree/admin/components/_search-picker.css
index c8e1d1889c..4097995405 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_search-picker.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_search-picker.css
@@ -8,7 +8,7 @@
}
.search-picker__option {
- @apply relative mb-2 flex cursor-pointer items-center border border-transparent rounded-md pr-8;
+ @apply relative mb-2 flex cursor-pointer items-center border border-transparent rounded-md pe-8;
}
.search-picker__option label {
@@ -29,7 +29,7 @@
}
.search-picker__option:has(input:checked)::after {
- @apply inline-block absolute right-2 w-6 h-6;
+ @apply inline-block absolute end-2 w-6 h-6;
content: '';
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-check text-zinc-950"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/></svg>') no-repeat center center;
}
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_tables.css b/spree/admin/app/assets/tailwind/spree/admin/components/_tables.css
index 038d650c54..71b23cb174 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_tables.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_tables.css
@@ -121,7 +121,7 @@
/* Filters search bar */
#filters-search-bar {
- @apply max-w-xs mr-auto;
+ @apply max-w-xs me-auto;
}
/* Table active filters */
diff --git a/spree/admin/app/assets/tailwind/spree/admin/index.css b/spree/admin/app/assets/tailwind/spree/admin/index.css
index c9fe974f2f..c11655d4f5 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/index.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/index.css
@@ -47,6 +47,7 @@
/* Components - Layout */
@import "./components/_layout.css";
+@import "./components/_rtl.css";
@import "./components/_filters.css";
@import "./components/_search-picker.css";
@import "./components/_sortable-tree.css";
diff --git a/spree/admin/app/assets/tailwind/spree/admin/plugins/_tom-select.css b/spree/admin/app/assets/tailwind/spree/admin/plugins/_tom-select.css
index 6d27416634..3327ae9af5 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/plugins/_tom-select.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/plugins/_tom-select.css
@@ -16,7 +16,7 @@
/* Dropdown */
.ts-dropdown,
.ts-dropdown.form-input {
- @apply absolute mt-2! top-full left-0 w-full h-auto p-1 z-[10000000]! bg-white rounded-lg;
+ @apply absolute mt-2! top-full start-0 w-full h-auto p-1 z-[10000000]! bg-white rounded-lg;
box-shadow: var(--shadow-dropdown);
}
@@ -34,7 +34,7 @@
}
.ts-dropdown .create {
- @apply pl-3;
+ @apply ps-3;
}
.ts-dropdown-content {
@@ -131,7 +131,7 @@
/* Multi-select items */
.ts-wrapper.multi .ts-control > div {
- @apply cursor-pointer mr-[3px] mb-[3px] py-[1px] px-[5px] text-gray-800 border-0 border-gray-200 rounded-[calc(var(--radius-md)-1px)];
+ @apply cursor-pointer me-[3px] mb-[3px] py-[1px] px-[5px] text-gray-800 border-0 border-gray-200 rounded-[calc(var(--radius-md)-1px)];
background: #efefef;
}
@@ -140,7 +140,7 @@
}
.ts-wrapper.multi.has-items .ts-control {
- @apply pl-[calc(0.75rem-5px)];
+ @apply ps-[calc(0.75rem-5px)];
}
/* Disabled state */
@@ -266,7 +266,7 @@
}
.ts-wrapper .ts-control > .item .remove {
- @apply inline-block align-middle text-base font-semibold ml-[3px] py-0 px-[3px] text-inherit no-underline rounded-sm opacity-50;
+ @apply inline-block align-middle text-base font-semibold ms-[3px] py-0 px-[3px] text-inherit no-underline rounded-sm opacity-50;
}
.ts-wrapper .ts-control > .item .remove:hover {
@@ -276,7 +276,7 @@
/* Clear button plugin */
.ts-wrapper .clear-button {
- @apply absolute right-[calc(0.75rem+20px)] top-1/2 -translate-y-1/2 opacity-0 cursor-pointer transition-opacity duration-200;
+ @apply absolute end-[calc(0.75rem+20px)] top-1/2 -translate-y-1/2 opacity-0 cursor-pointer transition-opacity duration-200;
}
.ts-wrapper.focus .clear-button,
diff --git a/spree/admin/app/assets/tailwind/spree/admin/plugins/_trix.css b/spree/admin/app/assets/tailwind/spree/admin/plugins/_trix.css
index 2ecbaecf63..50a53c0cc6 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/plugins/_trix.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/plugins/_trix.css
@@ -85,7 +85,7 @@
}
trix-toolbar .trix-dialog .trix-button {
- @apply inline-block text-center align-middle select-none text-sm leading-normal bg-gray-50 font-normal py-2 px-4 mr-1 mb-0 rounded-lg border border-gray-200!;
+ @apply inline-block text-center align-middle select-none text-sm leading-normal bg-gray-50 font-normal py-2 px-4 me-1 mb-0 rounded-lg border border-gray-200!;
}
trix-toolbar .trix-dialog__link-fields {
diff --git a/spree/admin/app/assets/tailwind/spree/admin/plugins/_uppy.css b/spree/admin/app/assets/tailwind/spree/admin/plugins/_uppy.css
index d245758cd8..8ab62bd6b4 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/plugins/_uppy.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/plugins/_uppy.css
@@ -66,7 +66,7 @@
}
.uppy-Dashboard-browse {
- @apply ml-2;
+ @apply ms-2;
}
/* Save button - btn btn-primary btn-sm styles */
diff --git a/spree/admin/app/assets/tailwind/spree/admin/views/_page-builder.css b/spree/admin/app/assets/tailwind/spree/admin/views/_page-builder.css
index 3e0e82a3ec..014e838ec8 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/views/_page-builder.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/views/_page-builder.css
@@ -11,7 +11,7 @@
}
#page-builder #content {
- @apply ml-0 pt-0;
+ @apply ms-0 pt-0;
}
#page-builder #main-part {
@@ -51,7 +51,9 @@
}
#page-builder-sidebar {
- @apply fixed left-0 bg-white border-r border-gray-200 overflow-x-hidden;
+ @apply fixed bg-white overflow-x-hidden;
+ inset-inline-start: 0;
+ border-inline-end: 1px solid var(--color-gray-200);
width: var(--pb-sidebar-width);
top: var(--pb-header-height);
height: calc(100vh - var(--pb-header-height));
@@ -64,7 +66,8 @@
}
#page-builder-sidebar .sidebar-footer {
- @apply fixed bottom-0 left-0 p-2 bg-white flex items-center justify-between;
+ @apply fixed bottom-0 p-2 bg-white flex items-center justify-between;
+ inset-inline-start: 0;
width: calc(var(--pb-sidebar-width) - 1px);
box-shadow: 0 0 0 1px var(--color-gray-200);
z-index: 1031;
@@ -115,7 +118,7 @@
}
.sidebar-page-block {
- margin-left: 25px;
+ margin-inline-start: 25px;
}
.edit-block .trix-button--icon-heading-1,
@@ -166,7 +169,7 @@
@media (min-width: 768px) {
#main-part {
- margin-left: 339px;
+ margin-inline-start: 339px;
}
.mobileLiveView #page-builder-preview {
diff --git a/spree/admin/app/controllers/concerns/spree/admin/locale_concern.rb b/spree/admin/app/controllers/concerns/spree/admin/locale_concern.rb
index 011813eb86..c3ac7de65b 100644
--- a/spree/admin/app/controllers/concerns/spree/admin/locale_concern.rb
+++ b/spree/admin/app/controllers/concerns/spree/admin/locale_concern.rb
@@ -25,11 +25,11 @@ module Spree
# Read all record content in the store's content locale, independent of
# the chosen UI language.
def pin_content_locale!
- Mobility.locale = current_store&.default_locale.presence || I18n.default_locale
+ Mobility.locale = (defined?(current_store) && current_store&.default_locale.presence) || I18n.default_locale
end
def admin_user_selected_locale
- try_spree_current_user&.selected_locale
+ defined?(try_spree_current_user) && try_spree_current_user&.selected_locale
end
def admin_locale_cookie
diff --git a/spree/admin/app/controllers/spree/admin/base_controller.rb b/spree/admin/app/controllers/spree/admin/base_controller.rb
index fc64c6fcd3..9d441ba256 100644
--- a/spree/admin/app/controllers/spree/admin/base_controller.rb
+++ b/spree/admin/app/controllers/spree/admin/base_controller.rb
@@ -8,6 +8,7 @@ module Spree
default_form_builder Spree::Admin::FormBuilder
helper 'spree/base'
+ helper 'spree/admin/rtl'
helper 'spree/admin/navigation'
helper 'spree/locale'
helper 'spree/currency'
diff --git a/spree/admin/app/controllers/spree/admin/user_sessions_controller.rb b/spree/admin/app/controllers/spree/admin/user_sessions_controller.rb
index 93dc2e5f8b..1b9e055982 100644
--- a/spree/admin/app/controllers/spree/admin/user_sessions_controller.rb
+++ b/spree/admin/app/controllers/spree/admin/user_sessions_controller.rb
@@ -5,6 +5,7 @@ module Spree
include Spree::Admin::LocaleConcern
helper 'spree/locale'
+ helper 'spree/admin/rtl'
layout 'spree/minimal'
diff --git a/spree/admin/app/helpers/spree/admin/dropdown_helper.rb b/spree/admin/app/helpers/spree/admin/dropdown_helper.rb
index bd6ec26256..7870301a1c 100644
--- a/spree/admin/app/helpers/spree/admin/dropdown_helper.rb
+++ b/spree/admin/app/helpers/spree/admin/dropdown_helper.rb
@@ -16,6 +16,8 @@ module Spree
options[:placement] || 'bottom-start'
end
+ placement = flip_placement_for_rtl(placement)
+
# Extract portal option
portal = options.delete(:portal)
@@ -49,6 +51,18 @@ module Spree
content_tag(:div, options, &block)
end
+
+ def flip_placement_for_rtl(placement)
+ return placement unless rtl_locale?
+
+ case placement
+ when 'bottom-start' then 'bottom-end'
+ when 'bottom-end' then 'bottom-start'
+ when 'top-start' then 'top-end'
+ when 'top-end' then 'top-start'
+ else placement
+ end
+ end
end
end
end
diff --git a/spree/admin/app/helpers/spree/admin/navigation_helper.rb b/spree/admin/app/helpers/spree/admin/navigation_helper.rb
index 3747b4a12a..45025f0e4e 100644
--- a/spree/admin/app/helpers/spree/admin/navigation_helper.rb
+++ b/spree/admin/app/helpers/spree/admin/navigation_helper.rb
@@ -404,7 +404,7 @@ module Spree
result = label.to_s
if badge_value.present?
css_class = badge_class.presence || 'badge-light'
- result += content_tag(:span, badge_value, class: "badge ml-auto #{css_class}")
+ result += content_tag(:span, badge_value, class: "badge ms-auto #{css_class}")
end
if tooltip_text.present?
result += tooltip(tooltip_text)
diff --git a/spree/admin/app/helpers/spree/admin/rtl_helper.rb b/spree/admin/app/helpers/spree/admin/rtl_helper.rb
new file mode 100644
index 0000000000..8373dc08ee
--- /dev/null
+++ b/spree/admin/app/helpers/spree/admin/rtl_helper.rb
@@ -0,0 +1,13 @@
+module Spree
+ module Admin
+ module RtlHelper
+ def rtl_locale?(locale = I18n.locale)
+ Spree::Admin::Rtl.rtl_locale?(locale)
+ end
+
+ def html_dir(locale = I18n.locale)
+ Spree::Admin::Rtl.html_dir(locale)
+ end
+ end
+ end
+end
diff --git a/spree/admin/app/views/active_storage/_upload_form.html.erb b/spree/admin/app/views/active_storage/_upload_form.html.erb
index 96ea03c6a2..4047c45398 100644
--- a/spree/admin/app/views/active_storage/_upload_form.html.erb
+++ b/spree/admin/app/views/active_storage/_upload_form.html.erb
@@ -52,7 +52,7 @@
</button>
<% if show_delete_button %>
- <button type="button" class="btn btn-danger ml-auto" data-action="active-storage-upload#remove" data-turbo-confirm="<%= Spree.t(:are_you_sure) %>">
+ <button type="button" class="btn btn-danger ms-auto" data-action="active-storage-upload#remove" data-turbo-confirm="<%= Spree.t(:are_you_sure) %>">
<%= icon('trash') %>
<%= Spree.t('actions.destroy') %>
diff --git a/spree/admin/app/views/layouts/spree/admin.html.erb b/spree/admin/app/views/layouts/spree/admin.html.erb
index dbcf636473..1a0a7cd6a1 100644
--- a/spree/admin/app/views/layouts/spree/admin.html.erb
+++ b/spree/admin/app/views/layouts/spree/admin.html.erb
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="<%= I18n.locale %>">
+<html lang="<%= I18n.locale %>" dir="<%= html_dir %>">
<head>
<%= render "spree/admin/shared/head" %>
<%= render "spree/admin/shared/custom_head" %>
diff --git a/spree/admin/app/views/layouts/spree/admin_settings.html.erb b/spree/admin/app/views/layouts/spree/admin_settings.html.erb
index 78704db78c..aab8f01f59 100644
--- a/spree/admin/app/views/layouts/spree/admin_settings.html.erb
+++ b/spree/admin/app/views/layouts/spree/admin_settings.html.erb
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="<%= I18n.locale %>">
+<html lang="<%= I18n.locale %>" dir="<%= html_dir %>">
<head>
<%= render "spree/admin/shared/head" %>
</head>
diff --git a/spree/admin/app/views/layouts/spree/admin_wizard.html.erb b/spree/admin/app/views/layouts/spree/admin_wizard.html.erb
index 0a44bc0456..6c681d24d4 100644
--- a/spree/admin/app/views/layouts/spree/admin_wizard.html.erb
+++ b/spree/admin/app/views/layouts/spree/admin_wizard.html.erb
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="<%= I18n.locale %>">
+<html lang="<%= I18n.locale %>" dir="<%= html_dir %>">
<head>
<%= render "spree/admin/shared/head" %>
</head>
@@ -14,7 +14,7 @@
<%= link_to_with_icon 'arrow-back', Spree.t('admin.back_to_dashboard'), spree.admin_path, class: 'hover:bg-gray-100 flex justify-start gap-2 px-8 no-underline h-16 items-center' %>
<% if content_for?(:steps) %>
- <ol class="flex items-center list-none p-0 grow justify-between h-16 border-l border-gray-200" id="steps">
+ <ol class="flex items-center list-none p-0 grow justify-between h-16 border-s border-gray-200" id="steps">
<%= yield :steps %>
</ol>
<% end %>
diff --git a/spree/admin/app/views/layouts/spree/minimal.html.erb b/spree/admin/app/views/layouts/spree/minimal.html.erb
index af95ec3c83..d692dc5735 100644
--- a/spree/admin/app/views/layouts/spree/minimal.html.erb
+++ b/spree/admin/app/views/layouts/spree/minimal.html.erb
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="<%= I18n.locale %>">
+<html lang="<%= I18n.locale %>" dir="<%= html_dir %>">
<head>
<%= render "spree/admin/shared/head" %>
</head>
diff --git a/spree/admin/app/views/spree/admin/assets/edit.html.erb b/spree/admin/app/views/spree/admin/assets/edit.html.erb
index 076067c20e..3ce972c1a8 100644
--- a/spree/admin/app/views/spree/admin/assets/edit.html.erb
+++ b/spree/admin/app/views/spree/admin/assets/edit.html.erb
@@ -66,7 +66,7 @@
<%= drawer_discard_button %>
<%= link_to Spree.t('actions.destroy'), object_url(@asset),
data: { turbo_method: :delete, turbo_confirm: Spree.t(:are_you_sure_delete), turbo_frame: '_top' },
- class: 'btn btn-danger ml-auto' if can?(:destroy, @asset) %>
+ class: 'btn btn-danger ms-auto' if can?(:destroy, @asset) %>
</div>
<% end %>
<% end %>
diff --git a/spree/admin/app/views/spree/admin/dashboard/_setup_progress.html.erb b/spree/admin/app/views/spree/admin/dashboard/_setup_progress.html.erb
index e75d72b2bc..bef925e085 100644
--- a/spree/admin/app/views/spree/admin/dashboard/_setup_progress.html.erb
+++ b/spree/admin/app/views/spree/admin/dashboard/_setup_progress.html.erb
@@ -1,14 +1,14 @@
<div class="card mb-6" id="setup_progress">
<div class="card-body">
<div class="mb-4">
- Your overall setup progress
- <span class="float-right badge badge-<%= current_store.setup_completed? ? 'success' : 'info' %>">
+ <%= Spree.t('admin.dashboard.setup_progress.title') %>
+ <span class="badge badge-<%= current_store.setup_completed? ? 'success' : 'info' %> inline-block">
<% if current_store.setup_completed? %>
<%= icon('check', class: 'text-green-700') %>
<% end %>
- <span>
- <strong><%= current_store.setup_tasks_done %></strong> of <%= current_store.setup_tasks_total %> steps done
+ <span dir="auto">
+ <%= Spree.t('admin.dashboard.setup_progress.steps_done_html', done: current_store.setup_tasks_done, total: current_store.setup_tasks_total) %>
</span>
</span>
</div>
diff --git a/spree/admin/app/views/spree/admin/dashboard/_setup_tasks.html.erb b/spree/admin/app/views/spree/admin/dashboard/_setup_tasks.html.erb
index 10565f97d0..58ff92a29a 100644
--- a/spree/admin/app/views/spree/admin/dashboard/_setup_tasks.html.erb
+++ b/spree/admin/app/views/spree/admin/dashboard/_setup_tasks.html.erb
@@ -8,13 +8,13 @@
<% is_expanded = task_in_progress == task %>
<div class="card overflow-hidden" data-controller="reveal" data-reveal-hidden-class="is-collapsed" id="setup_task_<%= task %>">
- <div class="card-header card-header--collapsible border-0 h-auto no-underline flex items-center p-3 text-gray-900 font-normal w-full bg-transparent cursor-pointer focus:outline-none focus:ring-0 hover:bg-gray-50"
+ <div class="card-header card-header--collapsible border-0 h-auto no-underline flex items-center gap-2 p-3 text-gray-900 font-normal w-full bg-transparent cursor-pointer focus:outline-none focus:ring-0 hover:bg-gray-50"
role="button"
tabindex="0"
data-action="click->reveal#toggle keydown.enter->reveal#toggle keydown.space->reveal#toggle">
<%= onboarding_check_circle(done) %>
<span class="ml-6 font-medium"><%= Spree.t("admin.store_setup_tasks.#{task}") %></span>
- <%= icon('chevron-right', class: 'arrow ml-auto transition-transform duration-200') %>
+ <%= icon('chevron-right', class: 'arrow ms-auto transition-transform duration-200') %>
</div>
<div data-reveal-target="item" class="collapsible-content <%= 'is-collapsed' unless is_expanded %>">
<div>
diff --git a/spree/admin/app/views/spree/admin/dashboard/_updater.html.erb b/spree/admin/app/views/spree/admin/dashboard/_updater.html.erb
index a40413d8db..9de90044b7 100644
--- a/spree/admin/app/views/spree/admin/dashboard/_updater.html.erb
+++ b/spree/admin/app/views/spree/admin/dashboard/_updater.html.erb
@@ -14,6 +14,6 @@
<% end %>
</div>
- <%= link_to '', spree.admin_dismiss_updater_notice_path, data: { turbo_method: :patch }, class: 'btn-close ml-auto' %>
+ <%= link_to '', spree.admin_dismiss_updater_notice_path, data: { turbo_method: :patch }, class: 'btn-close ms-auto' %>
</div>
<% end %>
\ No newline at end of file
diff --git a/spree/admin/app/views/spree/admin/integrations/_integration.html.erb b/spree/admin/app/views/spree/admin/integrations/_integration.html.erb
index 05bed2fbf7..f656125778 100644
--- a/spree/admin/app/views/spree/admin/integrations/_integration.html.erb
+++ b/spree/admin/app/views/spree/admin/integrations/_integration.html.erb
@@ -22,7 +22,7 @@
<%= Spree.t(:settings) %>
<% end if can?(:update, integration) %>
- <span class="ml-auto inline-flex items-center text-xs font-medium text-green-700">
+ <span class="ms-auto inline-flex items-center text-xs font-medium text-green-700">
<span class="w-1.5 h-1.5 rounded-full bg-green-500 mr-1"></span>
<%= Spree.t(:active) %>
</span>
diff --git a/spree/admin/app/views/spree/admin/line_items/new.html.erb b/spree/admin/app/views/spree/admin/line_items/new.html.erb
index 5d17674aa7..e667794eb1 100644
--- a/spree/admin/app/views/spree/admin/line_items/new.html.erb
+++ b/spree/admin/app/views/spree/admin/line_items/new.html.erb
@@ -18,7 +18,7 @@
</div>
</div>
<div class="dialog-footer">
- <div class="flex gap-2 m-0 items-center mr-auto">
+ <div class="flex gap-2 m-0 items-center me-auto">
<%= form.label :quantity, Spree.t(:quantity), class: "mb-0" %>
<%= form.number_field :quantity, class: "form-input", min: 1 %>
</div>
diff --git a/spree/admin/app/views/spree/admin/orders/_customer.html.erb b/spree/admin/app/views/spree/admin/orders/_customer.html.erb
index c02365a4e6..516d3faa43 100644
--- a/spree/admin/app/views/spree/admin/orders/_customer.html.erb
+++ b/spree/admin/app/views/spree/admin/orders/_customer.html.erb
@@ -4,7 +4,7 @@
<%= Spree.t(:customer) %>
</h5>
<% if can?(:update_customer, @order) || can?(:update_addresses, @order) %>
- <%= dropdown id: 'customer-edit-dropdown', class: 'ml-auto', portal: false do %>
+ <%= dropdown id: 'customer-edit-dropdown', class: 'ms-auto', portal: false do %>
<%= dropdown_toggle class: 'btn-light btn-sm px-1', data: { test_id: 'dropdown-toggle' } do %>
<%= icon 'dots-vertical', class: 'mr-0' %>
<% end %>
diff --git a/spree/admin/app/views/spree/admin/orders/_payments.html.erb b/spree/admin/app/views/spree/admin/orders/_payments.html.erb
index f8ad854786..9ee2ff46ea 100644
--- a/spree/admin/app/views/spree/admin/orders/_payments.html.erb
+++ b/spree/admin/app/views/spree/admin/orders/_payments.html.erb
@@ -7,7 +7,7 @@
</h5>
<% if @payments.any? %>
<span class="badge badge-info ml-2"><%= @payments.count %></span>
- <%= order_payment_state(@order, class: "ml-auto") %>
+ <%= order_payment_state(@order, class: "ms-auto") %>
<% end %>
</div>
<div class="card-body flex flex-col gap-2 px-2 pt-0 pb-2">
diff --git a/spree/admin/app/views/spree/admin/orders/_shipment.html.erb b/spree/admin/app/views/spree/admin/orders/_shipment.html.erb
index 68e3730fc1..cc341fc7c5 100644
--- a/spree/admin/app/views/spree/admin/orders/_shipment.html.erb
+++ b/spree/admin/app/views/spree/admin/orders/_shipment.html.erb
@@ -87,9 +87,9 @@
<% if can_ship?(shipment) %>
<div class="card-footer flex justify-end border-t bg-gray-25">
<% if shipment.tracked? %>
- <%= link_to_with_icon 'send.svg', Spree.t(:ship), spree.ship_admin_order_shipment_path(order, shipment), class: 'ml-auto btn btn-primary mb-0', data: {turbo_method: :post, turbo_confirm: Spree.t(:are_you_sure), turbo_frame: '_top'} %>
+ <%= link_to_with_icon 'send.svg', Spree.t(:ship), spree.ship_admin_order_shipment_path(order, shipment), class: 'ms-auto btn btn-primary mb-0', data: {turbo_method: :post, turbo_confirm: Spree.t(:are_you_sure), turbo_frame: '_top'} %>
<% elsif !shipment.digital? %>
- <span class="ship ml-auto btn btn-primary disabled mb-0" data-controller="tooltip" data-tooltip-placement-value="left">
+ <span class="ship ms-auto btn btn-primary disabled mb-0" data-controller="tooltip" data-tooltip-placement-value="left">
<%= icon 'send' %>
<%= Spree.t(:ship) %>
<%= tooltip(Spree.t('admin.shipment.please_provide_tracking_details')) %>
diff --git a/spree/admin/app/views/spree/admin/orders/_shipments.html.erb b/spree/admin/app/views/spree/admin/orders/_shipments.html.erb
index b4235bdca1..1ae81f9bcf 100644
--- a/spree/admin/app/views/spree/admin/orders/_shipments.html.erb
+++ b/spree/admin/app/views/spree/admin/orders/_shipments.html.erb
@@ -7,7 +7,7 @@
<% if @shipments.any? %>
<span class="badge badge-info ml-2"><%= @shipments.count %></span>
- <%= order_shipment_state(@order, class: "ml-auto") %>
+ <%= order_shipment_state(@order, class: "ms-auto") %>
<% end %>
</div>
<div class="card-body px-2 pt-0 pb-2 flex flex-col gap-2">
diff --git a/spree/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erb b/spree/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erb
index 8d3be406f0..061161c5ac 100644
--- a/spree/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erb
+++ b/spree/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erb
@@ -20,7 +20,7 @@ locals: {
<div class="form-actions">
<%= turbo_save_button_tag Spree.t("actions.update") %>
- <div class="ml-auto flex gap-6">
+ <div class="ms-auto flex gap-6">
<% if f.object.can_cancel? && can?(:cancel, f.object) %>
<%= link_to Spree.t("actions.cancel"),
spree.cancel_admin_return_authorization_path(f.object),
diff --git a/spree/admin/app/views/spree/admin/payments/_payment.html.erb b/spree/admin/app/views/spree/admin/payments/_payment.html.erb
index d098050896..19da9c274d 100644
--- a/spree/admin/app/views/spree/admin/payments/_payment.html.erb
+++ b/spree/admin/app/views/spree/admin/payments/_payment.html.erb
@@ -14,7 +14,7 @@
<%= payment_method_icon_tag(payment.payment_method.payment_icon_name) %>
<% end %>
<strong><%= payment.number.upcase %></strong>
- <%= spree_time(payment.created_at, class: 'ml-auto text-gray-600 text-sm') %>
+ <%= spree_time(payment.created_at, class: 'ms-auto text-gray-600 text-sm') %>
<%= dropdown do %>
<%= dropdown_toggle class: 'btn-light btn-sm px-1' do %>
diff --git a/spree/admin/app/views/spree/admin/shared/_content_header.html.erb b/spree/admin/app/views/spree/admin/shared/_content_header.html.erb
index cb3b373e6f..f4195f0656 100644
--- a/spree/admin/app/views/spree/admin/shared/_content_header.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_content_header.html.erb
@@ -13,7 +13,7 @@
<h3 class="page-header-title mb-0 flex items-center gap-4" id="page_title">
<%= yield :page_title %>
</h3>
- <div id="page_actions" class="ml-auto page-actions flex items-center gap-2">
+ <div id="page_actions" class="ms-auto page-actions flex items-center gap-2">
<%= yield :page_actions if content_for?(:page_actions) %>
<% if action_name == 'edit' && @object %>
diff --git a/spree/admin/app/views/spree/admin/shared/_edit_resource_links.html.erb b/spree/admin/app/views/spree/admin/shared/_edit_resource_links.html.erb
index 5fa7851912..19b7d69e85 100644
--- a/spree/admin/app/views/spree/admin/shared/_edit_resource_links.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_edit_resource_links.html.erb
@@ -3,6 +3,6 @@
<div class="form-actions">
<%= turbo_save_button_tag Spree.t('actions.update'), data: { admin_target: 'save' } %>
<% if f.object.can_be_deleted? && can?(:delete, f.object) %>
- <%= link_to Spree.t('actions.destroy'), destroy_url, data: { turbo_method: :delete, turbo_confirm: Spree.t(:are_you_sure_delete), turbo_frame: defined?(turbo_frame) ? turbo_frame : '_top' }, class: 'btn btn-danger ml-auto' %>
+ <%= link_to Spree.t('actions.destroy'), destroy_url, data: { turbo_method: :delete, turbo_confirm: Spree.t(:are_you_sure_delete), turbo_frame: defined?(turbo_frame) ? turbo_frame : '_top' }, class: 'btn btn-danger ms-auto' %>
<% end %>
</div>
diff --git a/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb b/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb
index 6964be64bd..5510f7afd8 100644
--- a/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb
@@ -2,7 +2,7 @@
<% badge_name ||= label %>
<% placeholder ||= [Spree.t(:search), controller_name.humanize.downcase].join(' ') %>
-<div class="form-input flex items-center py-0 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 grow max-lg:max-w-[300px] mr-auto max-lg:mb-4 transition-all duration-100 ease-in-out" id="filters-search-bar">
+<div class="form-input flex items-center py-0 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 grow max-lg:max-w-[300px] me-auto max-lg:mb-4 transition-all duration-100 ease-in-out" id="filters-search-bar">
<%= icon "search", class: "mr-4 text-gray-600" %>
<%= search_field_tag "q[#{param}]", params.dig(:q, param), class: "outline-none border-0 h-full focus:border-0 focus:ring-0 p-0 text-base w-full", placeholder: placeholder, data: { filters_target: :input, badge_name: badge_name } %>
</div>
diff --git a/spree/admin/app/views/spree/admin/shared/_head.html.erb b/spree/admin/app/views/spree/admin/shared/_head.html.erb
index cbfd900c7b..9a2cf7aac2 100644
--- a/spree/admin/app/views/spree/admin/shared/_head.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_head.html.erb
@@ -20,6 +20,9 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:[email protected]&family=Geist:[email protected]&display=swap" rel="stylesheet">
+<% if rtl_locale? %>
+<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:[email protected]&display=swap" rel="stylesheet">
+<% end %>
<%= stylesheet_link_tag 'spree/admin/application', media: :all, data: { turbo_track: "reload" } %>
<%= tinymce_assets %>
diff --git a/spree/admin/app/views/spree/admin/shared/_media_asset.html.erb b/spree/admin/app/views/spree/admin/shared/_media_asset.html.erb
index 3e6c612cbf..d1c8dc6cf5 100644
--- a/spree/admin/app/views/spree/admin/shared/_media_asset.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_media_asset.html.erb
@@ -3,7 +3,7 @@
<%= check_box_tag "ids[]", asset.id, false, class: "custom-control-input", id: "#{asset.id}-checkbox", data: { media_form_target: "checkbox", action: 'media-form#showDeleteButton' } %>
<label class="custom-control-label" for="<%= asset.id %>-checkbox"><span></span></label>
</div>
- <div class="move-handle text-center hidden ml-auto">
+ <div class="move-handle text-center hidden ms-auto">
<button class="btn btn-light btn-sm px-1"><%= icon('grip-vertical', class: 'mr-0') %></button>
</div>
diff --git a/spree/admin/app/views/spree/admin/shared/_media_form.html.erb b/spree/admin/app/views/spree/admin/shared/_media_form.html.erb
index 0913e8f523..dd055a68d0 100644
--- a/spree/admin/app/views/spree/admin/shared/_media_form.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_media_form.html.erb
@@ -1,7 +1,7 @@
<%= turbo_frame_tag 'media-form', class: 'card mb-6', data: { controller: 'media-form', media_form_delete_url_value: spree.bulk_destroy_admin_assets_path(viewable_id: viewable&.id) } do %>
<div class="card-header">
<h5 class="card-title mr-2"><%= Spree.t(:media) %></h5>
- <button type="button" data-media-form-target="deleteButton" class="btn btn-sm btn-danger btn-outline hidden ml-auto" data-action="media-form#deleteSelected">
+ <button type="button" data-media-form-target="deleteButton" class="btn btn-sm btn-danger btn-outline hidden ms-auto" data-action="media-form#deleteSelected">
<%= icon('trash') %>
<%= Spree.t(:delete_selected) %>
</button>
diff --git a/spree/admin/app/views/spree/admin/shared/_seo.html.erb b/spree/admin/app/views/spree/admin/shared/_seo.html.erb
index f2f123c403..6664770dc7 100644
--- a/spree/admin/app/views/spree/admin/shared/_seo.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_seo.html.erb
@@ -1,7 +1,7 @@
<div class="card mb-6 seo-form">
<div class="card-header flex justify-between">
<h5 class="card-title"><%= Spree.t(:search_engine_listing) %></h5>
- <button class="btn btn-light btn-sm ml-auto" data-action="click->seo-form#toggleInputs" type="button">Edit</button>
+ <button class="btn btn-light btn-sm ms-auto" data-action="click->seo-form#toggleInputs" type="button">Edit</button>
</div>
<div class="card-body flex flex-col">
<div class="seo__preview <% if title.blank? && description.blank? %>hidden<% else %>flex flex-col<% end %>" data-seo-form-target="preview">
diff --git a/spree/admin/app/views/spree/admin/shared/_sidebar.html.erb b/spree/admin/app/views/spree/admin/shared/_sidebar.html.erb
index a344474c55..2d432202a9 100644
--- a/spree/admin/app/views/spree/admin/shared/_sidebar.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_sidebar.html.erb
@@ -33,7 +33,7 @@
<%= render 'spree/admin/shared/sidebar/store_dropdown' %>
<% end %>
<% end %>
- <button type="button" class="btn btn-sm ml-auto" data-action="click->sidebar#closeMobile" aria-label="<%= Spree.t('admin.close_sidebar') %>">
+ <button type="button" class="btn btn-sm ms-auto" data-action="click->sidebar#closeMobile" aria-label="<%= Spree.t('admin.close_sidebar') %>">
<%= icon('x') %>
</button>
</div>
diff --git a/spree/admin/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb b/spree/admin/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb
index dbd6da609b..66401daeb3 100644
--- a/spree/admin/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb
@@ -20,7 +20,7 @@
</div>
</div>
- <div class="overflow-hidden text-gray-600 text-sm ml-auto">
+ <div class="overflow-hidden text-gray-600 text-sm ms-auto">
<% if taxon.classification_count.positive? %>
<%= pluralize(taxon.classification_count, Spree.t(:product)) %>
<% end %>
diff --git a/spree/admin/app/views/spree/admin/shipping_methods/form/_zones.html.erb b/spree/admin/app/views/spree/admin/shipping_methods/form/_zones.html.erb
index 920b5dff50..7dc73624e9 100644
--- a/spree/admin/app/views/spree/admin/shipping_methods/form/_zones.html.erb
+++ b/spree/admin/app/views/spree/admin/shipping_methods/form/_zones.html.erb
@@ -4,7 +4,7 @@
<%= Spree.t(:zones) %>
</h5>
- <%= link_to_with_icon('adjustments', Spree.t('admin.manage_zones'), spree.admin_zones_path, class: 'btn btn-sm btn-light ml-auto') if can?(:manage, Spree::Zone) %>
+ <%= link_to_with_icon('adjustments', Spree.t('admin.manage_zones'), spree.admin_zones_path, class: 'btn btn-sm btn-light ms-auto') if can?(:manage, Spree::Zone) %>
</div>
<div class="card-body">
diff --git a/spree/admin/app/views/spree/admin/tables/_table.html.erb b/spree/admin/app/views/spree/admin/tables/_table.html.erb
index 7b13b73622..cc4e3c7497 100644
--- a/spree/admin/app/views/spree/admin/tables/_table.html.erb
+++ b/spree/admin/app/views/spree/admin/tables/_table.html.erb
@@ -15,7 +15,7 @@
<div class="flex flex-col lg:flex-row gap-3 items-start lg:items-center justify-between">
<div class="flex gap-2 items-center flex-wrap">
<%= search_form_for @search, url: url_for, html: { data: { turbo_frame: frame_name, turbo_action: 'advance', controller: 'auto-submit search-clear', auto_submit_delay_value: 300 } } do |f| %>
- <div class="form-input flex items-center py-0 pr-1 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 lg:w-[300px] mr-auto h-[2rem] transition-all duration-100 ease-in-out">
+ <div class="form-input flex items-center py-0 pr-1 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 lg:w-[300px] me-auto h-[2rem] transition-all duration-100 ease-in-out">
<%= icon "search", class: "mr-4 text-gray-600 shrink-0" %>
<%= search_field_tag "q[#{search_param}]",
params.dig(:q, search_param),
diff --git a/spree/admin/app/views/spree/admin/variants/_variant.html.erb b/spree/admin/app/views/spree/admin/variants/_variant.html.erb
index c92a72481e..d98e6a8d82 100644
--- a/spree/admin/app/views/spree/admin/variants/_variant.html.erb
+++ b/spree/admin/app/views/spree/admin/variants/_variant.html.erb
@@ -5,7 +5,7 @@
<% variant_url = spree.edit_admin_product_variant_path(variant.product, variant) %>
<% end %>
- <%= link_to variant_url, id: dom_id(variant, 'spree'), data: { turbo_permanent: true, turbo_frame: :_top }, class: 'flex items-center justify-start no-underline' do %>
+ <%= link_to variant_url, id: dom_id(variant, 'spree'), data: { turbo_permanent: true, turbo_frame: :_top }, class: 'flex items-center justify-start no-underline gap-2' do %>
<%= render "spree/admin/shared/product_image", object: variant %>
<div class="ml-6">
<strong><%= variant.name %></strong>
diff --git a/spree/admin/config/locales/ar.yml b/spree/admin/config/locales/ar.yml
new file mode 100644
index 0000000000..23eb945180
--- /dev/null
+++ b/spree/admin/config/locales/ar.yml
@@ -0,0 +1,487 @@
+---
+ar:
+ action_text:
+ video_embed:
+ not_found: لا يمكن تضمين فيديو باستخدام عنوان URL المُقدَّم
+ spree:
+ i18n:
+ this_file_language: "العربية (AR)"
+ admin:
+ allowed_origins:
+ origin_help: أدخل عنوان URL الكامل لأصل متجرك (مثل https://myshop.com). لا تُضمِّن مسارات أو سلاسل استعلام.
+ origin_settings: إعدادات الأصل
+ amount_spent: المبلغ المُنفَق
+ api_keys:
+ example_request: طلب مثال
+ key_revoked_message: تم إلغاء مفتاح API هذا ولا يمكن استخدامه بعد الآن.
+ key_type_descriptions:
+ publishable: آمن للاستخدام في كود العميل مثل تطبيقات الجوال أو المتصفحات.
+ secret: احتفظ به بأمان واستخدمه على الخادم فقط. لا تعرّضه علناً أبداً.
+ key_types:
+ publishable: قابل للنشر
+ secret: سري
+ last_used_at: آخر استخدام
+ list: مفاتيح API
+ name_placeholder: 'مثال: تطبيق الجوال للإنتاج'
+ revoke: إلغاء
+ revoke_confirmation: هل أنت متأكد من إلغاء مفتاح API هذا؟ لا يمكن التراجع عن هذا الإجراء.
+ revoked: تم إلغاء مفتاح API
+ revoked_at: أُلغي في
+ revoked_by: أُلغي بواسطة
+ scopes: النطاقات
+ scopes_description: مطلوبة للمفاتيح السرية. اختر أضيق مجموعة نطاقات تحتاجها تكاملك.
+ scopes_immutable: النطاقات ثابتة عند إنشاء المفتاح. لتغييرها، أنشئ مفتاحاً جديداً بالنطاقات المطلوبة وألغِ هذا المفتاح.
+ secret_key_hidden: لا يمكن الكشف عن هذا المفتاح السري. إذا فقدته، ألغِ هذا المفتاح وأنشئ مفتاحاً جديداً.
+ statuses:
+ active: نشط
+ revoked: مُلغى
+ token_warning: احتفظ بهذا المفتاح بأمان. سيُعرَض مرة واحدة فقط.
+ usage: الاستخدام
+ usage_instructions:
+ publishable: استخدم هذا المفتاح لطلبات العميل. يمكن تضمينه بأمان في كود الواجهة الأمامية.
+ secret: استخدم هذا المفتاح لطلبات الخادم فقط. احتفظ به سرياً ولا تعرّضه في كود العميل.
+ audit_log: سجل التدقيق
+ avg_order_value: متوسط قيمة الطلب
+ back_to_dashboard: العودة إلى لوحة التحكم
+ bulk_ops:
+ customer_group_users:
+ body:
+ remove: هل أنت متأكد من إزالة العملاء المحددين من هذه المجموعة؟
+ title:
+ remove: إزالة من المجموعة
+ price_list_products:
+ body:
+ remove: هل أنت متأكد من إزالة المنتجات المحددة من قائمة الأسعار هذه؟ سيؤدي ذلك أيضاً إلى إزالة أسعارها.
+ title:
+ remove: إزالة من قائمة الأسعار
+ products:
+ body:
+ add_tags: 'اختر الوسوم لإضافتها إلى المنتجات:'
+ add_to_taxons: 'اختر الفئات لإضافة المنتجات إليها:'
+ remove_from_taxons: 'اختر الفئات لإزالة المنتجات منها:'
+ remove_tags: 'اختر الوسوم لإزالتها من المنتجات:'
+ set_active: تعيين المنتجات كنشطة سيجعلها متاحة في المتجر.
+ set_archived: تعيين المنتجات كمؤرشفة سيخفيها من المتجر.
+ set_draft: تعيين المنتجات كمسودة سيخفيها من المتجر.
+ title:
+ add_tags: إضافة وسوم
+ add_to_taxons: إضافة إلى فئات
+ remove_from_taxons: إزالة من فئات
+ remove_tags: إزالة وسوم
+ set_active: تعيين كنشط
+ set_archived: تعيين كمؤرشف
+ set_draft: تعيين كمسودة
+ users:
+ body:
+ add_tags: 'اختر الوسوم لإضافتها إلى العملاء:'
+ remove_tags: 'اختر الوسوم لإزالتها من العملاء:'
+ title:
+ add_tags: إضافة وسوم
+ remove_tags: إزالة وسوم
+ channels:
+ code_hint: معرّف قصير ومستقر (مثل "online" أو "pos" أو "wholesale"). يستخدمه عملاء API عبر ترويسة X-Spree-Channel ولإسناد الطلبات.
+ default: القناة الافتراضية
+ default_hint: قناة واحدة فقط لكل متجر هي الافتراضية. تُستخدم كاحتياطي عند عدم اختيار قناة وكهدف للنشر التلقائي للمنتجات الجديدة.
+ order_routing_strategy: استراتيجية توجيه الطلبات
+ order_routing_strategy_hint: يتجاوز استراتيجية التوجيه على مستوى المتجر للطلبات المُنسَبة إلى هذه القناة.
+ order_routing_strategy_inherit: وراثة من المتجر
+ checkout_settings:
+ checkout_links:
+ description: ستُعرَض روابط هذه الصفحات في تذييل صفحة الدفع.
+ label: روابط الدفع
+ checkout_message_description: مرئية لعملائك في صفحة الدفع في الشريط الجانبي الأيمن.
+ countries_managed_by_markets_html: تُدار الدول ومناطق الشحن عبر %{link}.
+ guest_checkout:
+ description: السماح للعملاء بإتمام الدفع دون إنشاء حساب.
+ label: السماح بالدفع كضيف
+ special_instructions:
+ description: السماح للعملاء بإضافة تعليمات خاصة إلى طلبهم.
+ label: عرض حقل التعليمات الخاصة
+ close_sidebar: إغلاق الشريط الجانبي
+ copied: تم النسخ!
+ copy_payment_link: نسخ رابط الدفع
+ copy_to_clipboard: نسخ إلى الحافظة
+ coupon_codes:
+ unused: غير مستخدم
+ used: مستخدم
+ created_at: تاريخ الإنشاء
+ dashboard:
+ getting_started:
+ description: كل ما تحتاجه للإعداد وبدء البيع.
+ hi: مرحباً
+ setup_progress:
+ steps_done_html: <strong>%{done}</strong> من أصل %{total} خطوات مكتملة
+ title: تقدم الإعداد العام
+ top_products: أفضل المنتجات
+ view_report: عرض التقرير
+ whats_happening_on_html: إليك ما يحدث اليوم على <strong>%{store_name}</strong>.
+ datetime_field_timezone_help: 'المنطقة الزمنية: %{zone}'
+ digital_shipment_fulfillment_note: سيُعلَّم هذا الشحن كمُنجَز بمجرد قيام المستخدم بتنزيل المنتج الرقمي
+ display_on_options:
+ back_end: في لوحة الإدارة فقط
+ both: في لوحة الإدارة والمتجر معاً
+ front_end: في المتجر فقط
+ documentation: التوثيق
+ edit_billing_address: تعديل عنوان الفوترة
+ edit_contact_information: تعديل معلومات الاتصال
+ edit_profile: تعديل الملف الشخصي
+ edit_shipping_address: تعديل عنوان الشحن
+ edit_theme: تعديل السمة
+ errors: الأخطاء
+ execution_time: وقت التنفيذ
+ expand_sidebar: توسيع الشريط الجانبي
+ export_all: تصدير جميع السجلات (قد يكون بطيئاً للمجموعات الكبيرة)
+ export_coupons: تصدير القسائم كملف CSV
+ export_created: بدأ التصدير. ستتلقى بريداً إلكترونياً برابط التنزيل عند جاهزيته!
+ export_only_filtered_records: تصدير السجلات المُصفّاة فقط، المطابقة لمعايير البحث
+ export_report: تصدير التقرير كملف CSV
+ filters: عوامل التصفية
+ getting_started: البدء
+ gift_card_batches:
+ codes_count: عدد الأكواد
+ new_gift_card_batch: دفعة بطاقات هدايا جديدة
+ prefix: البادئة
+ gift_cards:
+ active: نشط
+ all_statuses: جميع الحالات
+ code_help_text: إذا تركته فارغاً، سنُنشئ كوداً لك
+ redeemed: مُستخدَم
+ usage: الاستخدام
+ imports:
+ all_required_columns_mapped: أحسنت، جميع الأعمدة المطلوبة مُربَطة!
+ field_required: الحقل مطلوب
+ import_done: اكتمل!
+ large_import_background_note: يمكنك إغلاق هذه الصفحة — سيستمر الاستيراد في الخلفية.
+ large_import_message: يحتوي هذا الاستيراد على %{count} صف وهو كبير جداً للعرض بشكل فردي.
+ large_import_summary: "%{completed} مكتمل، %{failed} فشل"
+ mapping_required: هذا الحقل مطلوب
+ please_map_all_required_fields: يرجى ربط جميع الحقول المطلوبة للمتابعة.
+ waiting_for_file_to_be_processed: في انتظار معالجة الملف...
+ integrations:
+ invalid_integration_type: هذا التكامل غير مسموح
+ page_subtitle: اربط متجرك بخدمات خارجية لتحسين تجربة العملاء.
+ json_preview:
+ no_api_response: لم يُعثَر على استجابة API لهذا المورد
+ manage_markets: إدارة الأسواق
+ manage_properties: إدارة الخصائص
+ manage_stock_locations: إدارة مواقع المخزون
+ manage_taxons: إدارة الفئات
+ manage_zones: إدارة المناطق
+ markets:
+ edit: تعديل السوق
+ list: الأسواق
+ new: سوق جديد
+ supported_locales_hint: قائمة مفصولة بفواصل لرموز اللغات الإضافية (مثل fr,de,es)
+ metafield_definitions:
+ edit_warning: لا يمكنك تغيير نوع المورد أو نوع الحقل المخصص بعد استخدام التعريف.
+ used_in: مستخدم في
+ name: الاسم
+ navigation:
+ nested_under: متداخل تحت
+ newsletter_subscribers:
+ all: الكل
+ unverified: غير مُتحقَّق
+ verified: مُتحقَّق
+ not_tracking_inventory: لا يُتتبَّع المخزون
+ notifications: الإشعارات
+ num_orders: عدد الطلبات
+ oauth_applications:
+ client_id: معرّف العميل
+ client_secret: سر العميل
+ last_used: آخر استخدام
+ list: مفاتيح API
+ never: أبداً
+ new: مفتاح API جديد
+ read_and_write: قراءة وكتابة
+ read_only: قراءة فقط
+ scopes: النطاقات
+ order:
+ events:
+ approve: الموافقة
+ cancel: الإلغاء
+ resend: إعادة الإرسال
+ resume: الاستئناف
+ orders:
+ add_user_to_this_order: إضافة عميل إلى هذا الطلب
+ all_orders: جميع الطلبات
+ canceled: مُلغى
+ fulfilled: مُنجَز
+ no_email_present: يرجى إضافة عنوان بريد إلكتروني لإرسال رابط الدفع
+ orders_to_fulfill: طلبات للتنفيذ
+ partially_refunded: مُسترد جزئياً
+ payment_link_sent: أُرسِل رابط الدفع إلى العميل
+ provide_email: أدخل عنوان بريد إلكتروني
+ refunded: مُسترد
+ remove_user_from_this_order: إزالة العميل من هذا الطلب
+ unfulfilled: غير مُنجَز
+ page_builder:
+ background_color: لون الخلفية
+ border_bottom_width: عرض الحد السفلي
+ border_color: لون الحد
+ border_top_width: عرض الحد العلوي
+ bottom_padding: الحشو السفلي
+ button_alignment: محاذاة الزر
+ button_background_color: لون خلفية الزر
+ button_style: نمط الزر
+ button_text: نص الزر
+ button_text_color: لون نص الزر
+ category: الفئة
+ description: الوصف
+ description_alignment: محاذاة الوصف
+ desktop_image_alignment: محاذاة الصورة لسطح المكتب
+ desktop_logo_height: ارتفاع الشعار (سطح المكتب)
+ heading: العنوان
+ heading_alignment: محاذاة العنوان
+ heading_size: حجم العنوان
+ height: الارتفاع
+ image_click_hint: النقر على الصورة سينقل المستخدم إلى الصفحة/URL المحددة
+ left_aligned: محاذاة لليسار
+ logo_centered: الشعار في المنتصف
+ max_video_width_on_desktop: أقصى عرض للفيديو على سطح المكتب
+ maximum_products_to_show: الحد الأقصى للمنتجات المعروضة
+ nav_centered: التنقل في المنتصف
+ not_set: غير مُعيَّن
+ separated: منفصل
+ show_more_button: عرض زر استكشاف الفئة
+ show_taxon_image: عرض صورة الفئة
+ text_color: لون النص
+ title: العنوان
+ top_padding: الحشو العلوي
+ use_description_from_admin: استخدام الوصف من لوحة الإدارة
+ vertical_alignment: المحاذاة العمودية
+ youtube_video_url: عنوان URL لفيديو YouTube
+ personal_details: البيانات الشخصية
+ price_lists:
+ activate: تفعيل
+ activated: تم تفعيل قائمة الأسعار
+ confirm_activate: هل أنت متأكد من تفعيل قائمة الأسعار هذه؟ سيؤثر فوراً على التسعير.
+ confirm_deactivate: هل أنت متأكد من إلغاء تفعيل قائمة الأسعار هذه؟
+ confirm_schedule: هل أنت متأكد من جدولة قائمة الأسعار هذه؟
+ confirm_unschedule: هل أنت متأكد من إلغاء جدولة قائمة الأسعار هذه؟
+ deactivate: إلغاء التفعيل
+ deactivated: تم إلغاء تفعيل قائمة الأسعار
+ schedule: جدولة
+ scheduled: تمت جدولة قائمة الأسعار
+ unschedule: إلغاء الجدولة
+ product_translations:
+ coverage: تغطية الترجمة
+ locale: اللغة
+ manage_markets: إدارة الأسواق
+ no_locales_description: أعد إعداد أسواق بلغات إضافية لبدء ترجمة منتجاتك.
+ no_locales_title: لا توجد لغات إضافية مُكوَّنة
+ progress: التقدم
+ total: الإجمالي
+ translated: مُترجَم
+ products:
+ active: نشط
+ all_statuses: جميع الحالات
+ any_stock: أي مخزون
+ archived: مؤرشف
+ by_status: حسب الحالة
+ by_stock: حسب المخزون
+ deleted: محذوف
+ draft: مسودة
+ help_bubble: منتجات المسودة غير متاحة للشراء. المنتجات النشطة متاحة للعملاء.
+ in_stock: متوفر
+ inventory:
+ barcode: الباركود (ISBN, UPC, GTIN, إلخ)
+ sku: SKU (وحدة حفظ المخزون)
+ out_of_stock: غير متوفر
+ paused: متوقف
+ search_results:
+ no_products: لم نجد أي منتجات تطابق بحثك :(
+ seo:
+ placeholder: أضف عنواناً ووصفاً لمعاينة كيف قد يظهر هذا المنتج في نتائج محرك البحث
+ status_form:
+ status: منتجات المسودة غير متاحة للشراء. المنتجات النشطة متاحة للعملاء.
+ status_options:
+ active: نشط
+ archived: مؤرشف
+ draft: مسودة
+ stores:
+ choose_stores: اختر المتاجر التي يجب أن يكون هذا المنتج متاحاً فيها
+ variants:
+ option_types_link: لإضافة المزيد من أنواع الخيارات يرجى الانتقال إلى <a href="%{link}">أنواع الخيارات</a>
+ publishing:
+ caption_hidden_after: يُخفى في %{date}
+ caption_live: مرئي للعملاء الآن
+ caption_not_available: مخفي — المنتج %{product_status}
+ caption_scheduled: يُنشر في %{date}
+ caption_unpublished: أُخفي في %{date}
+ caption_window: متاح %{start} → %{end}
+ empty: غير مُدرَج في أي قناة بيع بعد.
+ inactive_marker: غير نشط
+ manage_cta: إدارة
+ manage_description: اختر قنوات البيع التي تُدرِج هذا المنتج. أوقف القناة لإزالته من كل مكان.
+ no_channels: لا توجد قنوات بيع متاحة. أنشئ واحدة في الإعدادات ← قنوات البيع.
+ published_at_label: النشر من
+ status_hidden: مخفي
+ status_live: متاح
+ status_not_available: غير متاح
+ status_scheduled: مجدول
+ title: النشر
+ unpublished_at_label: إلغاء النشر في
+ recommended_size: الحجم الموصى به
+ report_created: جاري إنشاء تقريرك. ستتلقى بريداً إلكترونياً برابط التنزيل عند جاهزيته!
+ reset_digital_link_download_limits: إعادة تعيين حدود التنزيل
+ response_code: رمز الاستجابة
+ selected: محدد
+ send_payment_link: إرسال رابط الدفع
+ shipment:
+ please_provide_tracking_details: قبل وضع علامة على الشحن كمُرسَل يرجى تقديم تفاصيل التتبع
+ shipment_transfer:
+ wrong_destination: وجهة خاطئة
+ show_json: عرض JSON
+ stock_transfers:
+ add_products_tip: تحتاج أولاً إلى اختيار موقع الوجهة
+ store_credit:
+ amount_remaining_of_total: "<strong>%{amount}</strong> متبقٍ (<strong>%{total}</strong> إجمالي)"
+ store_form:
+ company_field:
+ description: يعرض حقل الشركة في نموذج العنوان في قسم حسابي وفي خطوة عنوان الدفع.
+ label: عرض حقل عنوان الشركة
+ customer_support_email_help: هذا البريد الإلكتروني مرئي لزوار متجرك في قسم التذييل
+ new_order_notifications_email_help: إذا أردت تلقي إشعار بريد إلكتروني في كل مرة يقدّم فيها أحد طلباً، يرجى تقديم عنوان بريد إلكتروني لإرسال هذا الإشعار إليه
+ send_consumer_transactional_emails_help: عند إلغاء التحديد، لن تُرسَل رسائل المعاملات مثل تأكيدات الطلبات وإشعارات الشحن إلى العملاء
+ store_setup_tasks:
+ add_billing_address: إضافة عنوان الفوترة
+ add_products: إضافة منتجات
+ payment_methods:
+ copy: لتحصيل المدفوعات، يرجى إعداد مزوّد دفع إلكتروني واحد على الأقل.
+ done: أنت جاهز! يمكنك دائماً إدارة طرق الدفع في <a href="%{link}" data-turbo-frame="_top">هذه</a> الصفحة.
+ setup: إعداد طرق الدفع
+ title: يرجى إعداد طرق الدفع لمتجرك
+ set_customer_support_email: تعيين بريد دعم العملاء
+ setup_taxes_collection: إعداد تحصيل الضرائب
+ taxes:
+ copy: لتحصيل الضرائب، يرجى إعداد معدلات الضريبة.
+ done: أنت جاهز! يمكنك دائماً إدارة الضرائب في صفحة <a href="%{link}" data-turbo-frame="_top">الإعدادات</a>.
+ setup: إعداد معدلات الضريبة
+ storefront: المتجر
+ successful: ناجح
+ successfully_reset_digital_links_limit: تمت إعادة تعيين حدود التنزيل
+ tables:
+ add_filter: إضافة عامل تصفية
+ add_or_group: إضافة مجموعة OR
+ apply: تطبيق
+ apply_filters: تطبيق عوامل التصفية
+ ascending: تصاعدي
+ clear_all: مسح الكل
+ columns: الأعمدة
+ descending: تنازلي
+ enter_value: أدخل قيمة...
+ filter_builder: منشئ عوامل التصفية
+ filters: عوامل التصفية
+ match: مطابقة
+ of_the_following: مما يلي
+ operators:
+ contains: يحتوي على
+ does_not_contain: لا يحتوي على
+ ends_with: ينتهي بـ
+ equals: يساوي
+ greater_than: أكبر من
+ greater_than_or_equal: أكبر من أو يساوي
+ is_any_of: أي من
+ is_empty: فارغ
+ is_none_of: ليس أي من
+ is_not_empty: غير فارغ
+ less_than: أصغر من
+ less_than_or_equal: أصغر من أو يساوي
+ not_equals: لا يساوي
+ starts_with: يبدأ بـ
+ order: الترتيب
+ reset_to_default: إعادة إلى الافتراضي
+ select_field: اختر حقل...
+ sort_by: ترتيب حسب
+ visible_columns: الأعمدة المرئية
+ taxon_rules:
+ all_conditions: جميع الشروط
+ any_condition: أي شرط
+ available_on: متاح في
+ match_policies:
+ contains: يحتوي على
+ does_not_contain: لا يحتوي على
+ is_equal_to: يساوي
+ is_not_equal_to: لا يساوي
+ on_sale: في التخفيض
+ products_must_match: 'يجب أن تطابق المنتجات:'
+ tag: وسم المنتج
+ taxon_type: نوع الفئة
+ taxon_types:
+ automatic: تلقائي
+ automatic_info: إضافة المنتجات تلقائياً إلى هذه الفئة إذا طابقت القواعد التي تحددها.
+ manual: يدوي
+ manual_info: تنظيم المنتجات يدوياً. يمكنك إضافتها أو إزالتها بشكل جماعي.
+ translations:
+ no_translations_configured: لم تُكوَّن ترجمات. يرجى إعداد الأسواق لاستخدام الترجمات.
+ upload_new_asset: رفع وسائط جديدة
+ user:
+ last_order_placed: آخر طلب
+ no_store_credit: لا يمتلك العميل رصيد متجر متاح
+ users:
+ filters:
+ search_placeholder: البحث عن العملاء بالبريد الإلكتروني أو الاسم
+ utilities:
+ preview: معاينة
+ variants:
+ search_results:
+ no_variants: لم نجد أي متغيرات تطابق بحثك :(
+ variants_form:
+ add_option:
+ empty: أضف خيارات مثل الحجم أو اللون
+ not_empty: إضافة خيار آخر
+ compare_at_price_description: يُستخدم هذا السعر لعرض السعر المخفَّض في صفحة المنتج.
+ stock_locations_link: لإضافة المزيد من مواقع المخزون يرجى الانتقال إلى <a href="%{link}">مواقع المخزون</a>
+ total_inventory_html: 'إجمالي المخزون في موقع %{stock_location}: %{count} متاح'
+ vendors:
+ enterprise_feature: سوق متعدد البائعين متاح في الإصدار Enterprise
+ webhook_deliveries:
+ delivered_at: تم التسليم في
+ delivery_details: تفاصيل التسليم
+ delivery_info: معلومات التسليم
+ endpoint_inactive: لا يمكن إعادة المحاولة — نقطة النهاية غير نشطة
+ error_type: نوع الخطأ
+ event: الحدث
+ execution_time: وقت التنفيذ
+ failed: فشل
+ pending: قيد الانتظار
+ redeliver_button: إعادة التسليم
+ redelivered: تمت إعادة تسليم Webhook بنجاح.
+ request_errors: أخطاء الطلب
+ request_payload: حمولة الطلب
+ response_body: نص الاستجابة
+ response_code: رمز الاستجابة
+ webhook_endpoints:
+ auto_disabled: تم تعطيل نقطة النهاية هذه تلقائياً بعد فشل التسليم المتكرر.
+ back_to_endpoint: العودة إلى نقطة النهاية
+ deliveries: عمليات التسليم
+ endpoint_settings: إعدادات نقطة النهاية
+ event_subscriptions: اشتراكات الأحداث
+ event_subscriptions_help: اختر الأحداث التي يجب أن تُطلِق تسليم Webhook إلى نقطة النهاية هذه.
+ events: أحداث
+ failed_deliveries: عمليات التسليم الفاشلة
+ health:
+ degraded: "%{percentage}% نجاح"
+ disabled: معطّل
+ failing: "%{percentage}% نجاح"
+ healthy: "%{percentage}% نجاح"
+ no_deliveries: لا توجد بيانات
+ health_label: الصحة
+ new: نقطة نهاية Webhook جديدة
+ re_enable: إعادة التفعيل
+ secret_key: المفتاح السري
+ secret_key_help: استخدم هذا المفتاح للتحقق من توقيعات Webhook. احتفظ به بأمان ولا تشاركه علناً.
+ send_test: إرسال اختبار
+ subscriptions: الاشتراكات
+ successful_deliveries: عمليات التسليم الناجحة
+ test_failed: فشل إرسال Webhook الاختباري. يرجى التحقق من إعدادات نقطة النهاية.
+ test_sent: أُرسِل Webhook الاختباري. راجع عمليات التسليم للنتيجة.
+ webhooks_subscribers:
+ all_events: جميع الأحداث
+ new_webhooks_subscriber: مشترك Webhooks جديد
+ no_events: لا توجد أحداث
+ select_events: اختر الأحداث
+ subscribe_to_all_events: الاشتراك في جميع الأحداث
+ subscriptions: الاشتراكات
+ time_of_last_event: وقت آخر حدث
+ webhooks_events: أحداث Webhooks
diff --git a/spree/admin/config/locales/en.yml b/spree/admin/config/locales/en.yml
index 3a51085f22..0e69293e1e 100644
--- a/spree/admin/config/locales/en.yml
+++ b/spree/admin/config/locales/en.yml
@@ -107,6 +107,9 @@ en:
getting_started:
description: Everything you need to set up to start selling.
hi: Hi
+ setup_progress:
+ steps_done_html: <strong>%{done}</strong> of %{total} steps done
+ title: Your overall setup progress
top_products: Top products
view_report: View report
whats_happening_on_html: Here's what's happening on <strong>%{store_name}</strong> today.
diff --git a/spree/admin/lib/spree/admin/engine.rb b/spree/admin/lib/spree/admin/engine.rb
index ebc9806c00..26995f609e 100644
--- a/spree/admin/lib/spree/admin/engine.rb
+++ b/spree/admin/lib/spree/admin/engine.rb
@@ -1,4 +1,5 @@
require_relative 'runtime_configuration'
+require_relative 'rtl'
module Spree
module Admin
@@ -347,6 +348,10 @@ module Spree
app.config.spree_admin.tables = TablesEnvironment.new
end
+ initializer 'spree.admin.register_arabic_locale' do
+ Spree.register_available_locale(:ar)
+ end
+
# Add admin event subscribers
config.after_initialize do
Spree.subscribers.concat [
diff --git a/spree/admin/lib/spree/admin/rtl.rb b/spree/admin/lib/spree/admin/rtl.rb
new file mode 100644
index 0000000000..0fcf847eb1
--- /dev/null
+++ b/spree/admin/lib/spree/admin/rtl.rb
@@ -0,0 +1,26 @@
+module Spree
+ module Admin
+ # Detects right-to-left locales for the legacy admin UI layout direction
+ # (`<html dir="rtl">`). Admin-only — the React dashboard handles RTL itself
+ # via i18next, so this lives in the admin gem rather than core.
+ module Rtl
+ # ISO 639-1 language codes that use right-to-left scripts.
+ RTL_LANGUAGE_CODES = %w[ar he fa ur yi].freeze
+
+ module_function
+
+ # @param locale [String, Symbol]
+ # @return [Boolean]
+ def rtl_locale?(locale = I18n.locale)
+ language_code = locale.to_s.tr('_', '-').split('-', 2).first
+ RTL_LANGUAGE_CODES.include?(language_code)
+ end
+
+ # @param locale [String, Symbol]
+ # @return [String] "rtl" or "ltr"
+ def html_dir(locale = I18n.locale)
+ rtl_locale?(locale) ? 'rtl' : 'ltr'
+ end
+ end
+ end
+end
diff --git a/spree/admin/spec/helpers/spree/admin/dropdown_helper_spec.rb b/spree/admin/spec/helpers/spree/admin/dropdown_helper_spec.rb
new file mode 100644
index 0000000000..1cc58ba386
--- /dev/null
+++ b/spree/admin/spec/helpers/spree/admin/dropdown_helper_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe Spree::Admin::DropdownHelper, type: :helper do
+ describe '#flip_placement_for_rtl' do
+ context 'when the locale is LTR' do
+ before { allow(helper).to receive(:rtl_locale?).and_return(false) }
+
+ it 'returns the placement unchanged' do
+ expect(helper.flip_placement_for_rtl('bottom-start')).to eq('bottom-start')
+ end
+ end
+
+ context 'when the locale is RTL' do
+ before { allow(helper).to receive(:rtl_locale?).and_return(true) }
+
+ it 'mirrors start/end placements' do
+ expect(helper.flip_placement_for_rtl('bottom-start')).to eq('bottom-end')
+ expect(helper.flip_placement_for_rtl('bottom-end')).to eq('bottom-start')
+ expect(helper.flip_placement_for_rtl('top-start')).to eq('top-end')
+ expect(helper.flip_placement_for_rtl('top-end')).to eq('top-start')
+ end
+
+ it 'leaves centered placements unchanged' do
+ expect(helper.flip_placement_for_rtl('bottom')).to eq('bottom')
+ end
+ end
+ end
+end
diff --git a/spree/admin/spec/lib/spree/admin/rtl_spec.rb b/spree/admin/spec/lib/spree/admin/rtl_spec.rb
new file mode 100644
index 0000000000..d7f4051a17
--- /dev/null
+++ b/spree/admin/spec/lib/spree/admin/rtl_spec.rb
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe Spree::Admin::Rtl do
+ describe '.rtl_locale?' do
+ it 'returns true for Arabic' do
+ expect(described_class.rtl_locale?(:ar)).to be(true)
+ expect(described_class.rtl_locale?('ar-SA')).to be(true)
+ end
+
+ it 'returns true for other RTL languages' do
+ expect(described_class.rtl_locale?(:he)).to be(true)
+ expect(described_class.rtl_locale?(:fa)).to be(true)
+ end
+
+ it 'returns false for LTR languages' do
+ expect(described_class.rtl_locale?(:en)).to be(false)
+ expect(described_class.rtl_locale?(:de)).to be(false)
+ end
+ end
+
+ describe '.html_dir' do
+ it 'returns rtl for RTL locales' do
+ expect(described_class.html_dir(:ar)).to eq('rtl')
+ end
+
+ it 'returns ltr for LTR locales' do
+ expect(described_class.html_dir(:en)).to eq('ltr')
+ end
+ end
+end
diff --git a/spree/admin/spec/views/spree/admin/shared/_head.html.erb_spec.rb b/spree/admin/spec/views/spree/admin/shared/_head.html.erb_spec.rb
index 88f93583a0..284e25ca5b 100644
--- a/spree/admin/spec/views/spree/admin/shared/_head.html.erb_spec.rb
+++ b/spree/admin/spec/views/spree/admin/shared/_head.html.erb_spec.rb
@@ -27,4 +27,15 @@ describe 'spree/admin/shared/_head.html.erb', type: :view do
expect(rendered).to include('Acme')
end
end
+
+ context 'when the locale is RTL' do
+ before do
+ allow(view).to receive(:rtl_locale?).and_return(true)
+ end
+
+ it 'loads the Arabic web font' do
+ render
+ expect(rendered).to include('Noto+Sans+Arabic')
+ end
+ end
end
diff --git a/spree/core/lib/spree/i18n.rb b/spree/core/lib/spree/i18n.rb
index 61f43f91c8..abe2797b56 100644
--- a/spree/core/lib/spree/i18n.rb
+++ b/spree/core/lib/spree/i18n.rb
@@ -18,6 +18,7 @@ module Spree
def available_locales
locales = defined?(SpreeI18n) ? SpreeI18n::Locale.all.map(&:to_sym) : []
+ locales.concat(registered_available_locales)
locales << :en
locales << I18n.locale
locales << Rails.application.config.i18n.default_locale
@@ -25,6 +26,16 @@ module Spree
locales.uniq.compact
end
+ # Register a locale shipped by a Spree engine (e.g. admin-only translations).
+ # @param locale [String, Symbol]
+ def register_available_locale(locale)
+ registered_available_locales << locale.to_sym
+ end
+
+ def registered_available_locales
+ @registered_available_locales ||= []
+ end
+
alias t translate
end
end
diff --git a/spree/core/spec/lib/i18n_spec.rb b/spree/core/spec/lib/i18n_spec.rb
index 5ad7a59ae6..fc30f16301 100644
--- a/spree/core/spec/lib/i18n_spec.rb
+++ b/spree/core/spec/lib/i18n_spec.rb
@@ -45,6 +45,14 @@ describe 'i18n' do
expect(locales).to contain_exactly(:en)
end
+
+ it 'includes locales registered by Spree engines' do
+ Spree.register_available_locale(:ar)
+
+ expect(Spree.available_locales).to include(:ar)
+ ensure
+ Spree.registered_available_locales.delete(:ar)
+ end
end
end