Source
199
199
/**
200
200
* Initialize locale environment and gettext translations depending on language selected by user.
201
201
*
202
202
* Note: should be called before including file includes/translateDefines.inc.php.
203
203
*
204
204
* @param string $language Locale language prefix like en_US, ru_RU etc.
205
205
* @param string $error Message on failure.
206
206
*
207
207
* @return bool Whether locale could be switched.
208
208
*/
209
-
function setupLocale(string $language, string &$error = null): bool {
209
+
function setupLocale(string $language, ?string &$error = null): bool {
210
210
$locale_variants = zbx_locale_variants($language);
211
211
$locale_set = false;
212
212
213
213
ini_set('default_charset', 'UTF-8');
214
214
ini_set('mbstring.detect_order', 'UTF-8, ISO-8859-1, JIS, SJIS');
215
215
216
216
// Also, C locale is always present.
217
217
setlocale(LC_ALL, 'C');
218
218
219
219
if (function_exists('bindtextdomain')) {