From bb37a30321c8c96fabf36b65aab9896efb8b7178 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sun, 28 Mar 2021 18:58:41 +0200 Subject: [PATCH] Traduction repertoires equipments --- module/modules/swade-fr-init.js | 39 +++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/module/modules/swade-fr-init.js b/module/modules/swade-fr-init.js index 5da3571..bf7b1d7 100644 --- a/module/modules/swade-fr-init.js +++ b/module/modules/swade-fr-init.js @@ -54,7 +54,30 @@ Hooks.once('init', () => { const transFolder = { "Actor": "Acteur", "Edges": "Atouts"} const subFolder = { 'Social Edges': 'Atouts sociaux', 'Background Edges': 'Atouts de Background', 'Combat Edges': 'Atouts de combat', 'Leadership Edges': 'Atouts de commandement', 'Legendary Edges': 'Atouts légendaires', 'Power Edges': 'Atouts de pouvoir', -'Professional Edges': 'Atouts professionnels', 'Weird Edges': 'Atouts étranges', 'Edges': 'Atouts' } +'Professional Edges': 'Atouts professionnels', 'Weird Edges': 'Atouts étranges', 'Edges': 'Atouts', 'Hindrances': 'Handicaps', 'Skills': 'Compétences', +'Equipment': 'Equipement', 'Ammo': 'Munitions', 'Armor': 'Armure', 'Common Gear': 'Matériel commun', 'Modern Firearms': 'Armes à feu modernes', +'Personal Weapons': 'Armes', 'Special Weapons': 'Armes spéciales', 'Bullet': 'Balles', 'Cannon': 'Canon', 'Laser Battery': 'Batterie Laser', +'Adventuring Gear': 'Matériel d\'aventure', 'Animals and Tack': 'Animaux', 'Clothing': 'Vêtements', 'Computers & Electronics':'Ordinateurs et Electroniques', +'Firearms Accessories': 'Accessoires armes à feu', 'Food': 'Nourriture', 'Personal Defense': 'Auto-défense', 'Futuristic': 'Futuriste', +'Medieval & Ancient': 'Médiévale et Antiquité', 'Modern': 'Moderne', 'Shields': 'Boucliers', 'Laser (Futuristic)': 'Laser (Fururiste)', +'Machine Guns': 'Mitraillettes', 'Pistols': 'Pistolets', 'Rifles': 'Fusils', 'Submachine Guns': 'Semi-automatiques', 'Cannons': 'Canons', +'Catapults': 'Catapultes', 'Flamethrowers': 'Lance-flammes', 'Rocket Launchers & Torpedoes': 'Lance roquettes et torpilles', +'Vehicular Weapons': 'Armes de véhicules' } + +/************************************************************************************/ +const __translate_sub_folders = async (packName) => { + let pack = game.packs.get(packName) + pack.locked = false; + let folderEntityIds = pack.index.filter(x => x.name === "#[CF_tempEntity]"); + for ( let index of folderEntityIds) { + let folderEntity = await pack.getEntity(index._id); + //console.log("Fold1", folderEntity); + let newName = subFolder[folderEntity.data.flags.cf.name]; + if ( newName) { + await pack.updateEntity({ _id: index._id, 'flags.cf.name': newName } ); + } + } +} /************************************************************************************/ const __fix_folder_names = async ( ) => { @@ -67,17 +90,9 @@ const __fix_folder_names = async ( ) => { } } - let pack = game.packs.get("swade-core-rules.swade-edges") - pack.locked = false; - let folderEntityIds = pack.index.filter(x => x.name === "#[CF_tempEntity]"); - for ( let index of folderEntityIds) { - //console.log("Fold1", index); - let folderEntity = await pack.getEntity(index._id); - let newName = subFolder[folderEntity.data.flags.cf.name]; - if ( newName) { - await pack.updateEntity({ _id: index._id, 'flags.cf.name': newName } ); - } - } + __translate_sub_folders("swade-core-rules.swade-edges"); + __translate_sub_folders("swade-core-rules.swade-hindrances"); + __translate_sub_folders("swade-core-rules.swade-equipment"); }