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

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2023-05-05 14:03:14 +02:00
parent 263a6910c4
commit 505e467cc4
No known key found for this signature in database
GPG key ID: C400AAF20C1BB6FC

View file

@ -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);