File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed
Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change 33import { fileURLToPath } from 'url' ;
44import fs from 'fs' ;
55import path , { dirname } from 'path' ;
6+ import languages from './languages.js' ;
67
78const __filename = fileURLToPath ( import . meta. url ) ;
89const __dirname = dirname ( __filename ) ;
910const reportFile = path . join ( __dirname , '..' , 'broken-sites-report.json' ) ;
1011const missedFile = path . join ( __dirname , '..' , 'missed-sites-report.json' ) ;
1112const pluginDir = path . join ( __dirname , '..' , 'plugins' ) ;
1213
13- // Language lookup likely incomplete
14- const langLookup = {
15- 'العربية' : 'arabic' ,
16- 'chinese' : 'chinese' ,
17- 'English' : 'english' ,
18- 'Français' : 'french' ,
19- 'Bahasa Indonesia' : 'indonesian' ,
20- 'japanese' : 'japanese' ,
21- 'korean' : 'korean' ,
22- 'polish' : 'polish' ,
23- 'Português' : 'portuguese' ,
24- 'Русский' : 'russian' ,
25- 'Español' : 'spanish' ,
26- 'thai' : 'thai' ,
27- 'Türkçe' : 'turkish' ,
28- 'Українська' : 'ukrainian' ,
29- 'Tiếng Việt' : 'vietnamese' ,
30- } ;
14+ // Languages.js is backwards from what I want
15+ function swap ( json ) {
16+ var ret = { } ;
17+ for ( var key in json ) {
18+ ret [ json [ key ] ] = key ;
19+ }
20+ return ret ;
21+ }
22+
23+ const langLookup = swap ( languages ) ;
3124
3225async function renameFile ( oldFile , newFileInject = '.broken' ) {
3326 try {
You can’t perform that action at this time.
0 commit comments