Merge remote-tracking branch 'sasmira/master'

This commit is contained in:
Cyril 2021-03-29 01:34:43 +02:00
commit b5f5e8ea62

View File

@ -54,7 +54,30 @@ Hooks.once('init', () => {
const transFolder = { "Actor": "Acteur", "Edges": "Atouts"} const transFolder = { "Actor": "Acteur", "Edges": "Atouts"}
const subFolder = { 'Social Edges': 'Atouts sociaux', 'Background Edges': 'Atouts de Background', 'Combat Edges': 'Atouts de combat', 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', '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 ( ) => { const __fix_folder_names = async ( ) => {
@ -67,17 +90,9 @@ const __fix_folder_names = async ( ) => {
} }
} }
let pack = game.packs.get("swade-core-rules.swade-edges") __translate_sub_folders("swade-core-rules.swade-edges");
pack.locked = false; __translate_sub_folders("swade-core-rules.swade-hindrances");
let folderEntityIds = pack.index.filter(x => x.name === "#[CF_tempEntity]"); __translate_sub_folders("swade-core-rules.swade-equipment");
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 } );
}
}
} }