From a10f75360ba97462eeb1207bee021ebb7ccaadaf Mon Sep 17 00:00:00 2001 From: Miri Lipson Date: Mon, 23 Jan 2023 17:26:45 +0200 Subject: [PATCH] MDL-75047 icons: Define the orientation of the question mark in right-to-left languages. --- lang/en/langconfig.php | 1 + lib/classes/output/icon_system_fontawesome.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lang/en/langconfig.php b/lang/en/langconfig.php index e34c4019b70..71d0561021e 100644 --- a/lang/en/langconfig.php +++ b/lang/en/langconfig.php @@ -64,6 +64,7 @@ $string['strftimetime12'] = '%I:%M %p'; $string['strftimetime24'] = '%H:%M'; $string['thisdirection'] = 'ltr'; $string['thisdirectionvertical'] = 'btt'; +$string['thisicondirection'] = 'standard'; $string['thislanguage'] = 'English'; $string['thislanguageint'] = 'English'; $string['thousandssep'] = ','; diff --git a/lib/classes/output/icon_system_fontawesome.php b/lib/classes/output/icon_system_fontawesome.php index e3aa76c0250..7532cd04acd 100644 --- a/lib/classes/output/icon_system_fontawesome.php +++ b/lib/classes/output/icon_system_fontawesome.php @@ -497,8 +497,9 @@ class icon_system_fontawesome extends icon_system_font { $data['aria-hidden'] = $icon->attributes['aria-hidden']; } - // Flipping help icon direction in right-to-left languages. - if (right_to_left() && $data['key'] == "fa-question-circle text-info") { + // Define the orientation of the question mark in right-to-left languages. + $mirror = get_string('thisicondirection', 'langconfig'); + if ($mirror == 'mirror' && (strpos($data['key'], 'fa-question') !== false)) { $data['extraclasses'] = "fa-flip-horizontal"; }