Skip to content
This repository was archived by the owner on Jul 16, 2020. It is now read-only.

Commit 8f47124

Browse files
authored
Only handle arrays as arrays in translation files (#107)
* Fix array handling * Only handle arrays
1 parent 79a7025 commit 8f47124

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Generator.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use DirectoryIterator;
44
use Exception;
55
use App;
6+
use Traversable;
67

78
class Generator
89
{
@@ -281,10 +282,10 @@ private function adjustArray(array $arr)
281282
foreach ($arr as $key => $val) {
282283
$key = $this->removeEscapeCharacter($this->adjustString($key));
283284

284-
if (is_string($val)) {
285-
$res[$key] = $this->removeEscapeCharacter($this->adjustString($val));
286-
} else {
285+
if (is_array($val)) {
287286
$res[$key] = $this->adjustArray($val);
287+
} else {
288+
$res[$key] = $this->removeEscapeCharacter($this->adjustString($val));
288289
}
289290
}
290291
return $res;

0 commit comments

Comments
 (0)