Skip to content
Snippets Groups Projects
Commit dd9d30a2 authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

oops: Fix display of email template set language

parent 47901dd7
No related branches found
No related tags found
No related merge requests found
......@@ -157,7 +157,19 @@ class Internationalization {
}
}
static function getLanguageDescription($lang) {
$langs = self::availableLanguages();
$lang = strtolower($lang);
if (isset($langs[$lang]))
return $langs[$lang]['desc'];
else
return $lang;
}
static function availableLanguages($base=I18N_DIR) {
static $cache = false;
if ($cache) return $cache;
$langs = (include I18N_DIR . 'langs.php');
// Consider all subdirectories and .phar files in the base dir
......@@ -182,9 +194,9 @@ class Internationalization {
);
}
}
usort($installed, function($a, $b) { return strcasecmp($a['code'], $b['code']); });
uasort($installed, function($a, $b) { return strcasecmp($a['code'], $b['code']); });
return $installed;
return $cache = $installed;
}
// TODO: Move this to the REQUEST class or some middleware when that
......
......@@ -64,15 +64,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
<td width="180" class="required">
Language:
</td>
<td>
<?php
$langs = Internationalization::availableLanguages();
$lang = strtolower($info['lang']);
if (isset($langs[$lang]))
echo $langs[$lang]['desc'];
else
echo $info['lang']; ?>
</td>
<td><?php
echo Internationalization::getLanguageDescription($info['lang']);
?></td>
</tr>
<?php
$current_group = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment