From fd46d3d04ad3ab1453256b2ab620508e2ba33586 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 3 Jul 2025 10:35:30 +0300 Subject: [PATCH] feat(lang): Added `RTL` languages support (#2031) --- library/config.php | 2 ++ library/includes/page_header.php | 1 + styles/templates/admin/index.tpl | 2 +- styles/templates/default/page_header.tpl | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/library/config.php b/library/config.php index 9cba785ad..cfea5268e 100644 --- a/library/config.php +++ b/library/config.php @@ -204,6 +204,7 @@ $bb_cfg['lang'] = [ 'ar' => [ 'name' => 'Arabic', 'locale' => 'ar_SA.UTF-8', + 'rtl' => true, ], 'hy' => [ 'name' => 'Armenian', @@ -280,6 +281,7 @@ $bb_cfg['lang'] = [ 'he' => [ 'name' => 'Hebrew', 'locale' => 'he_IL.UTF-8', + 'rtl' => true, ], 'hi' => [ 'name' => 'Hindi', diff --git a/library/includes/page_header.php b/library/includes/page_header.php index e3bdc3e12..1ecfbafe6 100644 --- a/library/includes/page_header.php +++ b/library/includes/page_header.php @@ -117,6 +117,7 @@ $template->assign_vars([ 'USER_HIDE_CAT' => (BB_SCRIPT == 'index'), 'USER_LANG' => $userdata['user_lang'], + 'USER_LANG_DIRECTION' => (isset($bb_cfg['lang'][$userdata['user_lang']]['rtl']) && $bb_cfg['lang'][$userdata['user_lang']]['rtl'] === true) ? 'rtl' : 'ltr', 'INCLUDE_BBCODE_JS' => !empty($page_cfg['include_bbcode_js']), 'USER_OPTIONS_JS' => IS_GUEST ? '{}' : json_encode($user->opt_js, JSON_THROW_ON_ERROR), diff --git a/styles/templates/admin/index.tpl b/styles/templates/admin/index.tpl index 3c8f30941..b4608f091 100644 --- a/styles/templates/admin/index.tpl +++ b/styles/templates/admin/index.tpl @@ -1,7 +1,7 @@ - + diff --git a/styles/templates/default/page_header.tpl b/styles/templates/default/page_header.tpl index 0ec5fb8f5..a4b2db8bf 100644 --- a/styles/templates/default/page_header.tpl +++ b/styles/templates/default/page_header.tpl @@ -1,5 +1,5 @@ - +