Skip to content

Commit e35f4c0

Browse files
committed
Fix Invalid Meta
1 parent 1cdda3a commit e35f4c0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Gettext/Reader/JSONReader.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,8 @@ export default class JSONReader implements GettextReaderInterface {
136136
};
137137
type MetaTranslationObject = {
138138
'': {
139-
'': {
140-
msgid: '';
141-
msgstr: string[];
142-
};
139+
msgid: '';
140+
msgstr: string[];
143141
};
144142
}
145143
type TranslationObjects = {
@@ -155,7 +153,7 @@ export default class JSONReader implements GettextReaderInterface {
155153
const meta = translationsObject[''] as unknown as MetaTranslationObject;
156154
delete translationsObject['']; // delete meta
157155
if (is_object(meta) && is_object(meta[''])) {
158-
const translationObject = meta[''][''];
156+
const translationObject = meta[''];
159157
const msgid = translationObject.msgid;
160158
const msgstr = translationObject.msgstr;
161159
// the msgid is empty and msgstr is an array of strings

0 commit comments

Comments
 (0)