Compare commits
2
Commits
1683435d5d
...
c7c955ecad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7c955ecad | ||
|
|
af4be4ed7f |
+2
-3
@@ -31,8 +31,6 @@ class I18n implements MissingKeyInterface
|
|||||||
$this->dataReader = $dataReader;
|
$this->dataReader = $dataReader;
|
||||||
$this->cacheReader = $cacheReader;
|
$this->cacheReader = $cacheReader;
|
||||||
$this->missingKey = $missingKey;
|
$this->missingKey = $missingKey;
|
||||||
|
|
||||||
$this->locale = \Locale::getDefault() ?: $this->locale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initialize(bool $useCache) : bool
|
public function initialize(bool $useCache) : bool
|
||||||
@@ -136,7 +134,8 @@ class I18n implements MissingKeyInterface
|
|||||||
$search = [];
|
$search = [];
|
||||||
|
|
||||||
foreach($matches as $item) {
|
foreach($matches as $item) {
|
||||||
$search[ $item[0] ] = Iterate::arrayGet($parameters, $item[1]);
|
$iterate = Iterate::arrayGet($parameters, $item[1]);
|
||||||
|
$search[ $item[0] ] = $iterate !== null ? $iterate : $item[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return str_replace(array_keys($search), array_values($search), $string);
|
return str_replace(array_keys($search), array_values($search), $string);
|
||||||
|
|||||||
Reference in new issue
Block a user