MDL-78983 core: Preserve default behaviour of flipping question icon
Introduce a lang string `questioniconfollowlangdirection` that will allow the current behaviour of displaying the question mark icon in RTL languages in the same manner as the current language.
This commit is contained in:
@@ -41,8 +41,10 @@ $string['oldcharset'] = 'ISO-8859-1';
|
||||
$string['parentlanguage'] = '';
|
||||
$string['pm'] = 'pm';
|
||||
$string['pmcaps'] = 'PM';
|
||||
// Direction of the question mark icon for this language. Set to 'rtl' if the language needs to display it in right-to-left.
|
||||
$string['questionicondirection'] = 'ltr';
|
||||
// Whether the question icon follows the language direction.
|
||||
// E.g. In some RTL languages, like Arabic, it needs to be set to 'yes' so the question mark is flipped.
|
||||
// But for Hebrew, the question mark character is not flipped, so it needs to be set to 'no'.
|
||||
$string['questioniconfollowlangdirection'] = 'yes';
|
||||
$string['strftimedate'] = '%d %B %Y';
|
||||
$string['strftimedatemonthabbr'] = '%d %b %Y';
|
||||
$string['strftimedatemonthtimeshort'] = '%d %b %Y, %I:%M';
|
||||
|
||||
@@ -497,8 +497,9 @@ class icon_system_fontawesome extends icon_system_font {
|
||||
$data['aria-hidden'] = $icon->attributes['aria-hidden'];
|
||||
}
|
||||
|
||||
// Flip the orientation of the question mark if the value of the `questionicondirection` lang config string is set to `rtl`.
|
||||
if (strpos($data['key'], 'fa-question') !== false && get_string('questionicondirection', 'langconfig') === 'rtl') {
|
||||
// Flip question mark icon orientation when the `questioniconfollowlangdirection` lang config string is set to `yes`.
|
||||
$isquestionicon = strpos($data['key'], 'fa-question') !== false;
|
||||
if ($isquestionicon && right_to_left() && get_string('questioniconfollowlangdirection', 'langconfig') === 'yes') {
|
||||
$data['extraclasses'] = "fa-flip-horizontal";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user