View source for Setlocale

((/Forum/Discussion/OnceAgainAboutAnEmptyScreen))

Why is the Wacko engine doing the following in the ##set_language()## function (unchanged since R4.2)
%%
$this->lang['locale'] = setlocale(LC_CTYPE, 0);
%%
It calls ##setlocale## twice? Why it does this at all, is there a reason? Kinda of a fallback or just a leftover?

https://github.com/WackoWiki/wackowiki/blob/be71bfc2dd475c3e5403f2945c54215d24ef5adc/src/class/wacko.php#L671
##set_language()##
%%(php)
<?php

if (($old_lang != $lang || $update) && $this->known_language($lang))
{
	$this->load_translation($lang, $update);
	$this->lang = &$this->languages[$lang];

	setlocale(LC_CTYPE, $this->lang['locale']);
	setlocale(LC_TIME, $this->lang['locale']);	// sql_time_format()

	mb_internal_encoding('utf-8');

	$this->lang['locale'] = setlocale(LC_CTYPE, 0);
}
%%
Still looking for a solution, but maybe we can leave out the last line.

##lang/wacko.en.php##
%%(php)
<?php

$wacko_translation = [

	// language
	'lang_scheme'	=> [
		'name'		=> 'English',
		'code'		=> 'en',
		'dir'		=> 'ltr',
		'locale'	=> 'en_US.UTF-8',
	],
]
%%

((commit:5385279c855890e234d10a0fa36b21157c4a9e6c Patch)) - just removed the entire redundant line