diff options
author | Joas Schilling <coding@schilljs.com> | 2023-05-05 14:03:14 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-05-05 14:03:14 +0200 |
commit | 505e467cc424bcdffa0cb21404bd94ef23291816 (patch) | |
tree | fa6224e2951e603f4f2c34d2e132e10d1fa3901d | |
parent | 263a6910c41c07614e2a40349f2ae23e2fca0cb9 (diff) | |
download | nextcloud-server-505e467cc424bcdffa0cb21404bd94ef23291816.tar.gz nextcloud-server-505e467cc424bcdffa0cb21404bd94ef23291816.zip |
fix(translation): Don't use translation providers when from and to are the same
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/private/Translation/TranslationManager.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Translation/TranslationManager.php b/lib/private/Translation/TranslationManager.php index 2a2b2cd0066..8456c41cdfc 100644 --- a/lib/private/Translation/TranslationManager.php +++ b/lib/private/Translation/TranslationManager.php @@ -80,6 +80,10 @@ class TranslationManager implements ITranslationManager { } } + if ($fromLanguage === $toLanguage) { + return $text; + } + foreach ($this->getProviders() as $provider) { try { return $provider->translate($fromLanguage, $toLanguage, $text); |