mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-12-01 10:37:18 +01:00
Fix locale bugs, init_locale was not calling setlocale!?
This commit is contained in:
parent
6413bc78f6
commit
8d34866636
@ -29,14 +29,16 @@ mb_internal_encoding('UTF-8');
|
|||||||
loadConfig();
|
loadConfig();
|
||||||
|
|
||||||
function init_locale($locale, $error='error') {
|
function init_locale($locale, $error='error') {
|
||||||
if (_setlocale(LC_ALL, $locale) === false) {
|
if ($locale === 'en')
|
||||||
$error('The specified locale (' . $locale . ') does not exist on your platform!');
|
$locale = 'en_US.utf8';
|
||||||
}
|
|
||||||
if (extension_loaded('gettext')) {
|
if (extension_loaded('gettext')) {
|
||||||
|
setlocale(LC_ALL, $locale);
|
||||||
bindtextdomain('tinyboard', './inc/locale');
|
bindtextdomain('tinyboard', './inc/locale');
|
||||||
bind_textdomain_codeset('tinyboard', 'UTF-8');
|
bind_textdomain_codeset('tinyboard', 'UTF-8');
|
||||||
textdomain('tinyboard');
|
textdomain('tinyboard');
|
||||||
} else {
|
} else {
|
||||||
|
_setlocale(LC_ALL, $locale);
|
||||||
_bindtextdomain('tinyboard', './inc/locale');
|
_bindtextdomain('tinyboard', './inc/locale');
|
||||||
_bind_textdomain_codeset('tinyboard', 'UTF-8');
|
_bind_textdomain_codeset('tinyboard', 'UTF-8');
|
||||||
_textdomain('tinyboard');
|
_textdomain('tinyboard');
|
||||||
|
Loading…
Reference in New Issue
Block a user