1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 17:31:00 +01:00

Fix locale bugs, init_locale was not calling setlocale!?

This commit is contained in:
8chan 2014-12-03 00:17:24 -08:00
parent 6413bc78f6
commit 8d34866636

View File

@ -29,14 +29,16 @@ mb_internal_encoding('UTF-8');
loadConfig();
function init_locale($locale, $error='error') {
if (_setlocale(LC_ALL, $locale) === false) {
$error('The specified locale (' . $locale . ') does not exist on your platform!');
}
if ($locale === 'en')
$locale = 'en_US.utf8';
if (extension_loaded('gettext')) {
setlocale(LC_ALL, $locale);
bindtextdomain('tinyboard', './inc/locale');
bind_textdomain_codeset('tinyboard', 'UTF-8');
textdomain('tinyboard');
} else {
_setlocale(LC_ALL, $locale);
_bindtextdomain('tinyboard', './inc/locale');
_bind_textdomain_codeset('tinyboard', 'UTF-8');
_textdomain('tinyboard');