Check for same language
This commit is contained in:
parent
7a2f4dc54e
commit
71a38180e9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user