aboutsummaryrefslogtreecommitdiff
path: root/node_modules/po2json/test
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-11-03 01:33:53 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-11-03 01:33:53 +0100
commitd1291f67551c58168af43698a359cb5ddfd266b0 (patch)
tree55a13ed29fe1915e3f42f1b1b7038dafa2e975a7 /node_modules/po2json/test
parentd0a0695fb5d34996850723f7d4b1b59c3df909c2 (diff)
node_modules
Diffstat (limited to 'node_modules/po2json/test')
-rw-r--r--node_modules/po2json/test/fixtures/ja-jed1.x.json1
-rw-r--r--node_modules/po2json/test/fixtures/ja.json3
-rwxr-xr-xnode_modules/po2json/test/fixtures/ja.po5
-rw-r--r--node_modules/po2json/test/po2json_test.js14
4 files changed, 22 insertions, 1 deletions
diff --git a/node_modules/po2json/test/fixtures/ja-jed1.x.json b/node_modules/po2json/test/fixtures/ja-jed1.x.json
new file mode 100644
index 000000000..880341632
--- /dev/null
+++ b/node_modules/po2json/test/fixtures/ja-jed1.x.json
@@ -0,0 +1 @@
+{"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja"},"♂ Male":["男性"],"partner application":["パートナーアプリ"],"result":["検索結果"],"For %s person starting at %s":["For %1$s people starting at %2$s"]}}}
diff --git a/node_modules/po2json/test/fixtures/ja.json b/node_modules/po2json/test/fixtures/ja.json
index 35f2cdc7b..a562b0646 100644
--- a/node_modules/po2json/test/fixtures/ja.json
+++ b/node_modules/po2json/test/fixtures/ja.json
@@ -12,5 +12,6 @@
},
"♂ Male": [ null, "男性" ],
"partner application": [ "partner applications", [ "パートナーアプリ" ] ],
- "result": [ "results", [ "検索結果" ] ]
+ "result": [ "results", [ "検索結果" ] ],
+ "For %s person starting at %s": [ "For %s people starting at %s", ["For %1$s people starting at %2$s"] ]
}
diff --git a/node_modules/po2json/test/fixtures/ja.po b/node_modules/po2json/test/fixtures/ja.po
index 3310fa930..e590422a5 100755
--- a/node_modules/po2json/test/fixtures/ja.po
+++ b/node_modules/po2json/test/fixtures/ja.po
@@ -20,3 +20,8 @@ msgstr[0] "パートナーアプリ"
msgid "result"
msgid_plural "results"
msgstr[0] "検索結果"
+
+msgid "For %s person starting at %s"
+msgid_plural "For %s people starting at %s"
+msgstr[0] "For %1$s people starting at %2$s"
+
diff --git a/node_modules/po2json/test/po2json_test.js b/node_modules/po2json/test/po2json_test.js
index 18385274c..4239749b1 100644
--- a/node_modules/po2json/test/po2json_test.js
+++ b/node_modules/po2json/test/po2json_test.js
@@ -129,6 +129,20 @@ module.exports["parse with Plural-Forms == nplurals=1; plural=0;"] = {
}
}
+module.exports["parse with Plural-Forms == nplurals=1; plural=0; and with Jed1.x format"] = {
+ setUp: function(callback){
+ this.po = fs.readFileSync(__dirname + "/fixtures/ja.po");
+ this.json = JSON.parse(fs.readFileSync(__dirname + "/fixtures/ja-jed1.x.json", "utf-8"));
+ callback();
+ },
+
+ parse: function(test){
+ var parsed = po2json.parse(this.po, { format: 'jed1.x' });
+ test.deepEqual(parsed, this.json);
+ test.done();
+ }
+}
+
module.exports["parse with no headers"] ={
setUp: function(callback){
this.po = fs.readFileSync(__dirname + "/fixtures/en-no-header.po");