Skip to content

Commit 598859d

Browse files
Merge pull request #38097 from nextcloud/bugfix/38087/dont-translate-when-from-and-to-are-equal
fix(translation): Don't use translation providers when from and to ar…
2 parents b1c6b94 + 505e467 commit 598859d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/private/Translation/TranslationManager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ public function translate(string $text, ?string &$fromLanguage, string $toLangua
8080
}
8181
}
8282

83+
if ($fromLanguage === $toLanguage) {
84+
return $text;
85+
}
86+
8387
foreach ($this->getProviders() as $provider) {
8488
try {
8589
return $provider->translate($fromLanguage, $toLanguage, $text);

0 commit comments

Comments
 (0)