forked from MapComplete/MapComplete
		
	Fix: remove ghost bike translations from translation files and resync them, should fix the build
This commit is contained in:
		
							parent
							
								
									10e0e27778
								
							
						
					
					
						commit
						0487497e17
					
				
					 37 changed files with 1454 additions and 436 deletions
				
			
		|  | @ -3,15 +3,30 @@ import { Utils } from "../Utils" | |||
| import * as fs from "fs" | ||||
| 
 | ||||
| async function main(args: string[]) { | ||||
|     let directory = "./langs" | ||||
| 
 | ||||
|     { | ||||
|         const dirs = ["layers", "themes", "shared-questions"] | ||||
|         for (const dir of dirs) { | ||||
|             const layerIndex = args.findIndex((s) => s === "--" + dir) | ||||
|             if (layerIndex >= 0) { | ||||
|                 directory = "./langs/" + dir | ||||
|                 args.splice(layerIndex, 1) | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (args.length !== 1) { | ||||
|         console.log( | ||||
|             "Usage: first argument is the fully qualified key of the string to remove. Only removes translations in the core translations" | ||||
|             "Usage: first argument is the fully qualified key of the string to remove. Removes translations in the core translations, unless '--layers' or '--themes' is given" | ||||
|         ) | ||||
|         return | ||||
|     } | ||||
| 
 | ||||
|     // Path within the JSON which will be removed - not the path in the filesystem!
 | ||||
|     const path = args[0].split(".") | ||||
|     console.log("Removing translation string ", path, "from the general translations") | ||||
|     const files = ScriptUtils.readDirRecSync("./langs", 1).filter((f) => f.endsWith(".json")) | ||||
|     const files = ScriptUtils.readDirRecSync(directory, 1).filter((f) => f.endsWith(".json")) | ||||
|     for (const file of files) { | ||||
|         const json = JSON.parse(fs.readFileSync(file, { encoding: "utf-8" })) | ||||
|         Utils.WalkPath(path, json, (_) => undefined) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue