From: nupplaPhil Date: Sun, 29 Dec 2019 15:39:25 +0000 (+0100) Subject: Check for same language X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=71a38180e9ff066d98a404a0638701646bfa3ede;p=friendica.git Check for same language --- diff --git a/src/Core/L10n/L10n.php b/src/Core/L10n/L10n.php index be9e1419f3..ad4f653716 100644 --- a/src/Core/L10n/L10n.php +++ b/src/Core/L10n/L10n.php @@ -413,6 +413,11 @@ class L10n */ public function withLang(string $lang) { + // Don't create a new instance for same language + if ($lang === $this->lang) { + return $this; + } + $newL10n = clone $this; $newL10n->loadTranslationTable($lang); return $newL10n;