Skip to content

Commit

Permalink
Fixed #3692
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 23, 2019
1 parent 975afd2 commit 2a78466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/I18N.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2a78466

Please sign in to comment.