aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-05-05 14:03:14 +0200
committerJoas Schilling <coding@schilljs.com>2023-05-05 14:03:14 +0200
commit505e467cc424bcdffa0cb21404bd94ef23291816 (patch)
treefa6224e2951e603f4f2c34d2e132e10d1fa3901d
parent263a6910c41c07614e2a40349f2ae23e2fca0cb9 (diff)
downloadnextcloud-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.php4
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);