Skip to content

Commit

Permalink
Merge pull request #38097 from nextcloud/bugfix/38087/dont-translate-…
Browse files Browse the repository at this point in the history
…when-from-and-to-are-equal

fix(translation): Don't use translation providers when from and to ar…
  • Loading branch information
nickvergessen committed May 8, 2023
2 parents b1c6b94 + 505e467 commit 598859d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Translation/TranslationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public function translate(string $text, ?string &$fromLanguage, string $toLangua
}
}

if ($fromLanguage === $toLanguage) {
return $text;
}

foreach ($this->getProviders() as $provider) {
try {
return $provider->translate($fromLanguage, $toLanguage, $text);
Expand Down

0 comments on commit 598859d

Please sign in to comment.