Fix setting locale

This commit is contained in:
Alexander Shursha 2017-01-05 11:41:30 +03:00 committed by Franco Fichtner
parent fadc0ab5ad
commit e818a80539

View File

@ -56,15 +56,19 @@ class ControllerBase extends ControllerRoot
}
$lang_encoding = $lang . '.UTF-8';
$textdomain = 'OPNsense';
$ret = new ViewTranslator(array(
'directory' => '/usr/local/share/locale',
'defaultDomain' => 'OPNsense',
'defaultDomain' => $textdomain,
'locale' => $lang_encoding,
));
/* this isn't being done by Phalcon */
putenv('LANG=' . $lang_encoding);
textdomain($textdomain);
bindtextdomain($textdomain, '/usr/local/share/locale');
bind_textdomain_codeset($textdomain, $lang_encoding);
return $ret;
}