Skip to content

Commit a383414

Browse files
committed
Merge pull request #44 from tg-x/master
jed1.x: use msgid_plural when there is no translation
2 parents 76d31f4 + b55668e commit a383414

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

Diff for: lib/parse.js

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ module.exports = function(buffer, options) {
7575
if (options.format === 'jed1.x'){
7676
for (key in result) {
7777
if (result.hasOwnProperty(key) && key !== ''){
78+
for (var i = 2; i < result[key].length; i++){
79+
if ('' === result[key][i]){
80+
result[key][i] = result[key][0];
81+
}
82+
}
7883
result[key].shift();
7984
}
8085
}

Diff for: test/fixtures/pl-jed.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
"string context\u0004the contextual phrase": [
2929
null,
3030
"zwrot kontekstowe"
31+
],
32+
"a product": [
33+
"%d products",
34+
"",
35+
"",
36+
""
3137
]
3238
}
3339
}
34-
}
40+
}

Diff for: test/fixtures/pl-jed1.x.json

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
],
2424
"string context\u0004the contextual phrase": [
2525
"zwrot kontekstowe"
26+
],
27+
"a product": [
28+
"",
29+
"%d products",
30+
"%d products"
2631
]
2732
}
2833
}

Diff for: test/fixtures/pl.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,11 @@
3333
"string context\u0004the contextual phrase": [
3434
null,
3535
"zwrot kontekstowe"
36+
],
37+
"a product": [
38+
"%d products",
39+
"",
40+
"",
41+
""
3642
]
37-
}
43+
}

Diff for: test/fixtures/pl.po

+7
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ msgstr "Zdanie w \"cudzysłowie\"."
4949
#, fuzzy
5050
msgid "A fuzzy translation"
5151
msgstr "Tłumaczenie rozmyta"
52+
53+
#: test.js:7
54+
msgid "a product"
55+
msgid_plural "%d products"
56+
msgstr[0] ""
57+
msgstr[1] ""
58+
msgstr[2] ""

0 commit comments

Comments
 (0)