From 9f5537d4c5e8f2076b8b9fdef2a73636d4071156 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 6 Feb 2024 17:38:11 +0300 Subject: [PATCH] [common] fix font family for 'rtl' locale --- apps/common/main/lib/util/htmlutils.js | 8 ++++++++ apps/common/main/resources/less/variables.less | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index eb7cc9f7d6..0bdfeae078 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -61,6 +61,14 @@ if ( ui_rtl && !isIE ) { document.body.classList.add('rtl'); } +var isLangRtl = function (lang) { + return lang.lastIndexOf('ar', 0) === 0; +} + +if ( isLangRtl(window.lang || lang) ) { + document.body.classList.add('rtl-font'); +} + function checkScaling() { var matches = { 'pixel-ratio__1_25': "screen and (-webkit-min-device-pixel-ratio: 1.25) and (-webkit-max-device-pixel-ratio: 1.49), " + diff --git a/apps/common/main/resources/less/variables.less b/apps/common/main/resources/less/variables.less index 036883041b..d02a0fef86 100644 --- a/apps/common/main/resources/less/variables.less +++ b/apps/common/main/resources/less/variables.less @@ -56,7 +56,7 @@ // Typography // ------------------------- -.rtl { +.rtl-font { --font-family-base-custom: system-ui, -apple-system, "Geeza Pro", "Segoe UI", "Traditional Arabic", "Noto Sans"; }