Skip to content

Commit 6b07186

Browse files
committed
Verify i18n in CI
1 parent bba167c commit 6b07186

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.buildkite/pipeline.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,12 @@ steps:
4444
plugins:
4545
- docker#v3.0.1:
4646
image: "node:10"
47+
48+
- label: "🌐 i18n"
49+
command:
50+
# Do the things needed to actually run the i18n stuff
51+
- "yarn install"
52+
- "yarn diff-i18n"
53+
plugins:
54+
- docker#v3.0.1:
55+
image: "node:10"

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"reskindex:watch": "reskindex -h src/header -w",
3131
"i18n": "matrix-gen-i18n",
3232
"prunei18n": "matrix-prune-i18n",
33+
"diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && node scripts/compare-file.js src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
3334
"build:res": "node scripts/copy-res.js",
3435
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
3536
"build:compile": "yarn reskindex && babel --source-maps -d lib src",

scripts/compare-file.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const fs = require("fs");
2+
3+
if (process.argv.length < 4) throw new Error("Missing source and target file arguments");
4+
5+
const sourceFile = fs.readFileSync(process.argv[2], 'utf8');
6+
const targetFile = fs.readFileSync(process.argv[3], 'utf8');
7+
8+
if (sourceFile !== targetFile) {
9+
throw new Error("Files do not match");
10+
}

0 commit comments

Comments
 (0)