@@ -9,14 +9,16 @@ const abandoned = {}
9
9
const source = jsonfile . readFileSync ( './lang/en.json' )
10
10
const keys = Object . keys ( source )
11
11
12
+ const maxMissingKeys = 153
13
+
12
14
glob ( './lang/*.json' , { } , async function ( er , files ) {
13
15
await Promise . all (
14
16
files . map ( async filename => {
15
17
const lang = filename . replace ( / ^ ( .+ \/ ) ( [ a - z A - Z 0 - 9 - ] + ) ( \. j s o n ) $ / , '$2' )
16
18
if ( lang !== 'en' ) {
17
19
const json = jsonfile . readFileSync ( filename )
18
20
const missingKeys = keys . filter ( x => ! Object . keys ( json ) . includes ( x ) )
19
- if ( missingKeys . length < 100 ) {
21
+ if ( missingKeys . length <= maxMissingKeys ) {
20
22
unordered [ lang ] = missingKeys
21
23
missing = missing . concat ( unordered [ lang ] )
22
24
} else {
@@ -65,7 +67,7 @@ glob('./lang/*.json', {}, async function (er, files) {
65
67
if ( Object . keys ( abandoned ) . length > 0 ) {
66
68
output =
67
69
output +
68
- 'The following translations have more than 100 untranslated strings **' +
70
+ 'The following translations have more than ' + maxMissingKeys + ' untranslated strings **' +
69
71
Object . keys ( abandoned ) . join ( '**, **' ) +
70
72
'**, [are you able to help?](./ABANDONED.md)\n\n'
71
73
}
@@ -145,7 +147,7 @@ glob('./lang/*.json', {}, async function (er, files) {
145
147
source [ sourceKey ] . replace ( / \n / g, '\\n' ) +
146
148
'",\n'
147
149
} )
148
- output = output . substr ( 0 , output . length - 2 ) + '\n```\n'
150
+ output = output . substring ( 0 , output . length - 2 ) + '\n```\n'
149
151
} )
150
152
write ( './.github/ABANDONED.md' , output )
151
153
} else {
0 commit comments