From b44a83f21a610e1624b5bb452b1f2d7ebdd6d8be Mon Sep 17 00:00:00 2001 From: njarrar Date: Sat, 28 Nov 2026 14:35:41 +0400 Subject: [PATCH] Feature/add support for right-to-left languages Use CSS logical properties for the start and end utilities of Bootstrap and for the component styles that were tied to the left or right side, mirror the column offsets, keep numbers, signs and units in numeric order and keep the chart labels readable in right-to-left languages. The layout of left-to-right languages stays the same. --- .../asset-profile-dialog.component.scss | 2 +- .../home-overview/home-overview.scss | 4 +- .../portfolio-performance.component.html | 3 +- .../portfolio-summary.component.scss | 6 +-- .../import-activities-dialog.scss | 2 +- apps/client/src/styles.scss | 12 ++++- apps/client/src/styles/bootstrap.scss | 54 +++++++++++++++++++ libs/ui/src/lib/assistant/assistant.scss | 2 +- .../src/lib/carousel/carousel.component.html | 4 +- .../src/lib/carousel/carousel.component.scss | 3 ++ .../dialog-header.component.scss | 2 +- libs/ui/src/lib/fab/fab.component.scss | 2 +- ...storical-market-data-editor.component.scss | 2 +- .../symbol-autocomplete.component.scss | 2 +- .../trend-indicator.component.html | 1 + libs/ui/src/lib/value/value.component.html | 47 ++++++++-------- 16 files changed, 110 insertions(+), 38 deletions(-) diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.scss b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.scss index fbc938c9c7..b0b0989164 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.scss +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.scss @@ -10,7 +10,7 @@ .edit-asset-profile-identifier-container { bottom: 0; - right: 1rem; + inset-inline-end: 1rem; top: 0; } } diff --git a/apps/client/src/app/components/home-overview/home-overview.scss b/apps/client/src/app/components/home-overview/home-overview.scss index b074bc6261..1d1fec0217 100644 --- a/apps/client/src/app/components/home-overview/home-overview.scss +++ b/apps/client/src/app/components/home-overview/home-overview.scss @@ -38,12 +38,12 @@ a[mat-icon-button] { --mat-icon-button-icon-size: 1rem; - margin-right: -0.125rem; + margin-inline-end: -0.125rem; margin-top: -0.5rem; } mat-card-title { - padding-left: 0.1875rem; + padding-inline-start: 0.1875rem; } } diff --git a/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html b/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html index c458080e3c..3902b1c57f 100644 --- a/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html +++ b/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html @@ -1,5 +1,6 @@
-
+ +
@if ((errors()?.length ?? 0) > 0 && !isLoading()) { - + } @@ -26,6 +26,6 @@ tabindex="-1" (click)="next()" > - + } diff --git a/libs/ui/src/lib/carousel/carousel.component.scss b/libs/ui/src/lib/carousel/carousel.component.scss index 05ab9ff935..fe4493b448 100644 --- a/libs/ui/src/lib/carousel/carousel.component.scss +++ b/libs/ui/src/lib/carousel/carousel.component.scss @@ -1,4 +1,7 @@ :host { + // The scroll offsets assume a left-to-right flow, also in right-to-left + // languages + direction: ltr; display: block; position: relative; diff --git a/libs/ui/src/lib/dialog-header/dialog-header.component.scss b/libs/ui/src/lib/dialog-header/dialog-header.component.scss index bbf29d27e8..450270a0ff 100644 --- a/libs/ui/src/lib/dialog-header/dialog-header.component.scss +++ b/libs/ui/src/lib/dialog-header/dialog-header.component.scss @@ -7,7 +7,7 @@ .with-close-button { .text-center { - padding-left: 0.9375rem; + padding-inline-start: 0.9375rem; } } } diff --git a/libs/ui/src/lib/fab/fab.component.scss b/libs/ui/src/lib/fab/fab.component.scss index 78cfe47e2b..910fe1b10f 100644 --- a/libs/ui/src/lib/fab/fab.component.scss +++ b/libs/ui/src/lib/fab/fab.component.scss @@ -14,7 +14,7 @@ bottom: calc(constant(safe-area-inset-bottom) + 2rem); bottom: calc(env(safe-area-inset-bottom) + 2rem); position: fixed; - right: 2rem; + inset-inline-end: 2rem; z-index: 999; } } diff --git a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.scss b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.scss index cfeb30c8f9..1eec6041b2 100644 --- a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.scss +++ b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.scss @@ -9,7 +9,7 @@ .day { height: 0.5rem; - margin-right: 0.25rem; + margin-inline-end: 0.25rem; width: 0.5rem; &:hover { diff --git a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.scss b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.scss index 71c06f26ee..5d85165ac9 100644 --- a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.scss +++ b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.scss @@ -2,7 +2,7 @@ display: block; .mat-mdc-progress-spinner { - right: 0; + inset-inline-end: 0; top: calc(50% - 10px); } } diff --git a/libs/ui/src/lib/trend-indicator/trend-indicator.component.html b/libs/ui/src/lib/trend-indicator/trend-indicator.component.html index ef7e1fc4ea..0e251df773 100644 --- a/libs/ui/src/lib/trend-indicator/trend-indicator.component.html +++ b/libs/ui/src/lib/trend-indicator/trend-indicator.component.html @@ -27,6 +27,7 @@ } @else { diff --git a/libs/ui/src/lib/value/value.component.html b/libs/ui/src/lib/value/value.component.html index 066599a5d9..0e7da1899a 100644 --- a/libs/ui/src/lib/value/value.component.html +++ b/libs/ui/src/lib/value/value.component.html @@ -42,31 +42,34 @@ [class.justify-content-end]="position === 'end'" > @if (isNumber || value === null) { - @if (colorizeSign && !useAbsoluteValue && value !== null) { - @if (+value > 0) { -
+
+ +
+ @if (colorizeSign && !useAbsoluteValue && value !== null) { + @if (+value > 0) { +
+
+ } + @if (+value < 0) { +
-
+ } } - @if (+value < 0) { -
-
- } - } -
- @if (value === null) { - ***** - } @else { - {{ formattedValue }} +
+ @if (value === null) { + ***** + } @else { + {{ formattedValue }} + } +
+ @if (isPercent || unit) { +
+ {{ isPercent ? '%' : unit }} +
}
- @if (isPercent || unit) { -
- {{ isPercent ? '%' : unit }} -
- } } @if (isString) {