Browse Source

fix(translation): Don't use translation providers when from and to are the same

Signed-off-by: Joas Schilling <coding@schilljs.com>
Joas Schilling 1 year ago
parent
commit
505e467cc4
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/private/Translation/TranslationManager.php

+ 4 - 0
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);