diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index 5f8d64cd72c..909407eb374 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -9,6 +9,9 @@ ### Changed - URLs are no longer allowed in a user’s first or last names. +### Fixed +- Fixed a bug where `site` translations were falling back to English if the translated message was identical to the source message. ([#3692](https://github.com/craftcms/cms/issues/3692)) + ## 3.1.3 - 2019-01-21 ### Added diff --git a/src/i18n/I18N.php b/src/i18n/I18N.php index 2bd0b4e7b53..f910d6ed010 100644 --- a/src/i18n/I18N.php +++ b/src/i18n/I18N.php @@ -327,7 +327,7 @@ public function translate($category, $message, $params, $language) $translation = parent::translate($category, $message, $params, $language); // If $message is a key and came back identical to the input, translate it into the source language - if ($translation === $message) { + if ($translation === $message && !in_array($category, ['yii', 'site'], true)) { $messageSource = $this->getMessageSource($category); if ($messageSource->sourceLanguage !== $language) { $translation = parent::translate($category, $message, $params, $messageSource->sourceLanguage);