sforkowany z mirror/friendica
Check for same language
rodzic
7a2f4dc54e
commit
71a38180e9
|
@ -413,6 +413,11 @@ class L10n
|
||||||
*/
|
*/
|
||||||
public function withLang(string $lang)
|
public function withLang(string $lang)
|
||||||
{
|
{
|
||||||
|
// Don't create a new instance for same language
|
||||||
|
if ($lang === $this->lang) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
$newL10n = clone $this;
|
$newL10n = clone $this;
|
||||||
$newL10n->loadTranslationTable($lang);
|
$newL10n->loadTranslationTable($lang);
|
||||||
return $newL10n;
|
return $newL10n;
|
||||||
|
|
Ładowanie…
Reference in New Issue