mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-50829 lang: fix to RTL/LTR bracket confusion
Thanks to ISHIKAWA Takayuki for the initial patch
This commit is contained in:
parent
ea3ebbf20e
commit
0a7051ff5a
@ -188,7 +188,7 @@ echo html_writer::end_tag('td');
|
||||
$options = array();
|
||||
foreach ($availablelangs as $alang) {
|
||||
if (!empty($alang[0]) and trim($alang[0]) !== 'en' and !$controller->is_installed_lang($alang[0], $alang[1])) {
|
||||
$options[$alang[0]] = $alang[2].' ('.$alang[0].')';
|
||||
$options[$alang[0]] = $alang[2].' ‎('.$alang[0].')‎';
|
||||
}
|
||||
}
|
||||
if (!empty($options)) {
|
||||
|
@ -532,6 +532,11 @@ class core_string_manager_standard implements core_string_manager {
|
||||
$langdirs = get_list_of_plugins('', 'en', $this->otherroot);
|
||||
$langdirs["$CFG->dirroot/lang/en"] = 'en';
|
||||
|
||||
// We use left to right mark to demark the shortcodes contained in LTR brackets, but we need to do
|
||||
// this hacky thing to have the utf8 char until we go php7 minimum and can simply put \u200E in
|
||||
// a double quoted string.
|
||||
$lrm = json_decode('"\u200E"');
|
||||
|
||||
// Loop through all langs and get info.
|
||||
foreach ($langdirs as $lang) {
|
||||
if (strrpos($lang, '_local') !== false) {
|
||||
@ -548,7 +553,7 @@ class core_string_manager_standard implements core_string_manager {
|
||||
}
|
||||
$string = $this->load_component_strings('langconfig', $lang);
|
||||
if (!empty($string['thislanguage'])) {
|
||||
$languages[$lang] = $string['thislanguage'].' ('. $lang .')';
|
||||
$languages[$lang] = $string['thislanguage'].' '.$lrm.'('. $lang .')'.$lrm;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user