File tree 4 files changed +27
-1
lines changed
4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ module.exports = function(buffer, options) {
66
66
} ) ;
67
67
68
68
// Attach headers (overwrites any empty translation keys that may have somehow gotten in)
69
- result [ '' ] = parsed . headers ;
69
+ if ( parsed . headers ) {
70
+ result [ '' ] = parsed . headers ;
71
+ }
70
72
71
73
if ( options . format === 'mf' ) {
72
74
delete result [ '' ] ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "Hello World" : [
3
+ null ,
4
+ " Hello World"
5
+ ]
6
+ }
Original file line number Diff line number Diff line change
1
+ # Very minimal .po
2
+
3
+ msgid "Hello World"
4
+ msgstr "Hello World"
Original file line number Diff line number Diff line change @@ -128,3 +128,17 @@ module.exports["parse with Plural-Forms == nplurals=1; plural=0;"] = {
128
128
test . done ( ) ;
129
129
}
130
130
}
131
+
132
+ module . exports [ "parse with no headers" ] = {
133
+ setUp : function ( callback ) {
134
+ this . po = fs . readFileSync ( __dirname + "/fixtures/en-no-header.po" ) ;
135
+ this . json = JSON . parse ( fs . readFileSync ( __dirname + "/fixtures/en-no-header.json" , "utf-8" ) ) ;
136
+ callback ( ) ;
137
+ } ,
138
+
139
+ parse : function ( test ) {
140
+ var parsed = po2json . parse ( this . po ) ;
141
+ test . deepEqual ( parsed , this . json ) ;
142
+ test . done ( ) ;
143
+ }
144
+ }
You can’t perform that action at this time.
0 commit comments