File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -6,23 +6,28 @@ var { strings } = require('../intl/strings');
6
6
7
7
var easyRegex = / i n t l \. s t r \( \s * ' ( [ a - z A - Z \- ] + ) ' / g;
8
8
9
- var goodKeys = 0 ;
9
+ var allKetSet = new Set ( Object . keys ( strings ) ) ;
10
+ allKetSet . delete ( 'error-untranslated' ) ; // used in ./index.js
11
+
12
+ var goodKeySet = new Set ( ) ;
10
13
var validateKey = function ( key ) {
11
14
if ( ! strings [ key ] ) {
12
15
console . log ( 'NO KEY for: "' , key , '"' ) ;
13
16
} else {
14
- goodKeys ++ ;
17
+ goodKeySet . add ( key ) ;
18
+ allKetSet . delete ( key ) ;
15
19
}
16
20
} ;
17
21
18
22
if ( ! util . isBrowser ( ) ) {
19
- util . readDirDeep ( join ( __dirname , '../..' ) ) . forEach ( function ( path ) {
23
+ util . readDirDeep ( join ( __dirname , '../../ ' ) ) . forEach ( function ( path ) {
20
24
var content = readFileSync ( path ) ;
21
25
var match ;
22
26
while ( match = easyRegex . exec ( content ) ) {
23
- console . log ( match [ 1 ] )
24
27
validateKey ( match [ 1 ] ) ;
25
28
}
26
29
} ) ;
27
- console . log ( goodKeys + ' good keys found!' ) ;
30
+ console . log ( goodKeySet . size , ' good keys found!' ) ;
31
+ console . log ( allKetSet . size , ' keys did not use!' ) ;
32
+ console . log ( allKetSet ) ;
28
33
}
Original file line number Diff line number Diff line change @@ -71,4 +71,4 @@ exports.readDirDeep = function(dir) {
71
71
}
72
72
} ) ;
73
73
return paths ;
74
- }
74
+ } ;
You can’t perform that action at this time.
0 commit comments