]> git.mxchange.org Git - friendica.git/commitdiff
Check for same language
authornupplaPhil <admin@philipp.info>
Sun, 29 Dec 2019 15:39:25 +0000 (16:39 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 29 Dec 2019 15:39:25 +0000 (16:39 +0100)
src/Core/L10n/L10n.php

index be9e1419f39ab60cf2dbac73a41ef186ab2926f9..ad4f6537160464bf0b5a94ef92478e48fac5c0f8 100644 (file)
@@ -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;