From e49ecd9368e266fb3d66c8df100fb56c3975b5dc Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 4 Dec 2020 05:56:40 +0900 Subject: [PATCH 1/3] Implement auto RTL support for i18n locales like Arabic, Persian, etc. Fixes #255 --- frontend/src/app/components/app/app.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/app/app.component.ts b/frontend/src/app/components/app/app.component.ts index 6a961710a..59f4fed32 100644 --- a/frontend/src/app/components/app/app.component.ts +++ b/frontend/src/app/components/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, HostListener, OnInit } from '@angular/core'; +import { Component, HostListener, OnInit, Inject, LOCALE_ID, HostBinding } from '@angular/core'; import { Router, NavigationEnd } from '@angular/router'; import { WebsocketService } from '../../services/websocket.service'; import { StateService } from 'src/app/services/state.service'; @@ -15,7 +15,14 @@ export class AppComponent implements OnInit { public router: Router, private websocketService: WebsocketService, private stateService: StateService, - ) { } + @Inject(LOCALE_ID) private locale: string, + ) { + if (this.locale.startsWith('ar') || this.locale.startsWith('fa')) { + this.dir = 'rtl'; + } + } + + @HostBinding('attr.dir') dir = 'ltr'; @HostListener('document:keydown', ['$event']) handleKeyboardEvents(event: KeyboardEvent) { From 62363802bef1aee1a5d283052152dc960fded111 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 4 Dec 2020 22:41:58 +0900 Subject: [PATCH 2/3] Always render app-mempool-graph using LTR --- .../src/app/components/statistics/statistics.component.html | 2 +- .../src/app/components/television/television.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/statistics/statistics.component.html b/frontend/src/app/components/statistics/statistics.component.html index 872b48e06..88ebc2c29 100644 --- a/frontend/src/app/components/statistics/statistics.component.html +++ b/frontend/src/app/components/statistics/statistics.component.html @@ -45,7 +45,7 @@
- +
diff --git a/frontend/src/app/components/television/television.component.html b/frontend/src/app/components/television/television.component.html index 49e1bb1da..2b5273b11 100644 --- a/frontend/src/app/components/television/television.component.html +++ b/frontend/src/app/components/television/television.component.html @@ -5,7 +5,7 @@
- +
From 92d163f49557bd77cbb7c51137c6f69c4facc7b6 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 4 Dec 2020 22:54:09 +0900 Subject: [PATCH 3/3] More fixes for RTL --- frontend/src/app/components/about/about.component.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index 4924ab364..031dc9949 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -12,7 +12,7 @@

About the project

-
+

The mempool open-source project aims to implement a high quality explorer and visualization website for the entire Bitcoin ecosystem, without distractions like altcoins, advertising, or third-party trackers.

@@ -22,7 +22,7 @@

Maintainers