]> git.mjollnir.org Git - moodle.git/commitdiff
Strip the "_utf8" suffix from language names in list of languages.
authorstronk7 <stronk7>
Mon, 10 Apr 2006 23:07:37 +0000 (23:07 +0000)
committerstronk7 <stronk7>
Mon, 10 Apr 2006 23:07:37 +0000 (23:07 +0000)
Special info showed for non-utf8 English.
(http://moodle.org/bugs/bug.php?op=show&bugid=4924)

install.php

index 4af6ab35c6bf6ea9fd74adcc288f87a292fd3806..4d4703385f9f7fb9607036c7c7fbe2cab47a5bd4 100644 (file)
@@ -968,8 +968,16 @@ function get_installer_list_of_languages() {
     foreach ($langdirs as $lang) {
         if (file_exists($CFG->dirroot .'/install/lang/'. $lang .'/installer.php')) {
             include($CFG->dirroot .'/install/lang/'. $lang .'/installer.php');
+            if (substr($lang, -5) == '_utf8') {   //Remove the _utf8 suffix from the lang to show
+                $shortlang = substr($lang, 0, -5);
+            } else {
+                $shortlang = $lang;
+            }
+            if ($lang == 'en') {  //Explain this is non-utf8 en
+                $shortlang = 'non-utf8 en';
+            }
             if (!empty($string['thislanguage'])) {
-                $languages[$lang] = $string['thislanguage'] .' ('. $lang .')';
+                $languages[$lang] = $string['thislanguage'] .' ('. $shortlang .')';
             }
             unset($string);
         }