Permalink
Browse files

MDL-50829 lang: fix to RTL/LTR bracket confusion

Thanks to ISHIKAWA Takayuki for the initial patch
  • Loading branch information...
danpoltawski committed Dec 29, 2015
1 parent ea3ebbf commit 0a7051ff5a31bcfaf8f50305a90cebb830c7095f
Showing with 7 additions and 2 deletions.
  1. +1 −1 admin/tool/langimport/index.php
  2. +6 −1 lib/classes/string_manager_standard.php
@@ -188,7 +188,7 @@
$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 @@ public function get_list_of_translations($returnall = false) {
$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 @@ public function get_list_of_translations($returnall = false) {
}
$string = $this->load_component_strings('langconfig', $lang);
if (!empty($string['thislanguage'])) {
$languages[$lang] = $string['thislanguage'].' ('. $lang .')';
$languages[$lang] = $string['thislanguage'].' '.$lrm.'('. $lang .')'.$lrm;
}
}

0 comments on commit 0a7051f

Please sign in to comment.