Make L10n immutable

- Remove Push/Pop
- Add "withLang($lang)" method
This commit is contained in:
Philipp Holzer 2019-12-28 23:12:01 +01:00
commit 7a2f4dc54e
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
7 changed files with 109 additions and 171 deletions

View file

@ -38,17 +38,16 @@ function user_allow($hash)
Worker::add(PRIORITY_LOW, "Directory", $url);
}
L10n::pushLang($register['language']);
$l10n = L10n::withLang($register['language']);
$res = User::sendRegisterOpenEmail(
$l10n,
$user,
Config::get('config', 'sitename'),
$a->getBaseUrl(),
($register['password'] ?? '') ?: 'Sent in a previous email'
);
L10n::popLang();
if ($res) {
info(L10n::t('Account approved.') . EOL);
return true;