Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85628174
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1001 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/i18n/compare.js b/src/i18n/compare.js
new file mode 100755
index 0000000000..1e8715f365
--- /dev/null
+++ b/src/i18n/compare.js
@@ -0,0 +1,27 @@
+#!/usr/bin/env node
+const arg = process.argv[2]
+const english = require('./en.json')
+const foreign = require(`./${arg}.json`)
+
+function walker (a, b, path = []) {
+ Object.keys(a).forEach(k => {
+ const aVal = a[k]
+ const bVal = b[k]
+ const aType = typeof aVal
+ const bType = typeof bVal
+ const currentPath = [...path, k]
+ const article = aType[0] === 'o' ? 'an' : 'a'
+
+ if (bType === 'undefined') {
+ console.log(`Foreign language is missing ${article} ${aType} at path ${currentPath.join('.')}`)
+ } else if (aType === 'object') {
+ if (bType !== 'object') {
+ console.log(`Type mismatch! English has ${aType} while foreign has ${bType} at path ${currentPath.join['.']}`)
+ } else {
+ walker(aVal, bVal, currentPath)
+ }
+ }
+ })
+}
+
+walker(english, foreign)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Aug 8, 10:56 AM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1723110
Default Alt Text
(1001 B)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment