Skip to content

Commit

Permalink
Fixed translations for empty value - PHP 5.6 fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbankowski committed May 13, 2019
1 parent 41be76d commit de22244
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ouzo/Core/Translator.php
Expand Up @@ -24,7 +24,8 @@ public function __construct($language, $labels)
public function translate($key, $params = [])
{
$explodedKey = explode('.', $key);
$translation = Arrays::getNestedValue($this->_labels, $explodedKey) ?? $key;
$value = Arrays::getNestedValue($this->_labels, $explodedKey);
$translation = $value === null ? $key : $value;
return $this->localize(Strings::sprintAssoc($translation, $params));
}

Expand Down

0 comments on commit de22244

Please sign in to comment.