Skip to content

Commit 0241eb1

Browse files
Merge pull request #341 from N1ebieski/Fix-Cannot-access-offset-of-type-array-on-array-#26
Fix Cannot access offset of type array on array
2 parents 8606969 + 61ff2c1 commit 0241eb1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

php-templates/translations.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ protected function fromJsonFile($file, $path, $namespace)
298298
[$json, $lines] = $this->linesFromJsonFile($file);
299299

300300
foreach ($json as $key => $value) {
301+
if (!array_key_exists($key, $lines) || is_array($value)) {
302+
continue;
303+
}
304+
301305
yield [
302306
"k" => $key,
303307
"la" => $lang,

src/templates/translations.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ $translator = new class
298298
[$json, $lines] = $this->linesFromJsonFile($file);
299299
300300
foreach ($json as $key => $value) {
301+
if (!array_key_exists($key, $lines) || is_array($value)) {
302+
continue;
303+
}
304+
301305
yield [
302306
"k" => $key,
303307
"la" => $lang,

0 commit comments

Comments
 (0)