Skip to content

Commit

Permalink
2.7.1 Fixed a bug where translations were not loaded properly ([#37](#37
Browse files Browse the repository at this point in the history
)).
  • Loading branch information
smcyr committed Jan 28, 2022
1 parent 07fb7cf commit b8213e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.7.1 - 2022-01-28

### Fixed
- Fixed a bug where translations were not loaded properly ([#37](https://github.com/MutationDigitale/craft3-translate/issues/37)).

## 2.7.0 - 2022-01-27

### Changed
Expand Down
4 changes: 2 additions & 2 deletions src/services/DbMessageSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class DbMessageSource extends \yii\i18n\DbMessageSource
protected function loadMessagesFromDb($category, $language)
{
$messagesFromDb = parent::loadMessagesFromDb($category, $language);
array_walk($messagesFromDb, function(&$key, $value) {
$key = $value ?? $key;
array_walk($messagesFromDb, function(&$value, $key) {
$value = $value ?? $key;
});
return $messagesFromDb;
}
Expand Down

0 comments on commit b8213e6

Please sign in to comment.