Auto-translate spells + parse eis items

This commit is contained in:
LeRatierBretonnien 2020-04-30 21:56:09 +02:00
parent d1fc5afbcb
commit 7256dc14c2
2 changed files with 26 additions and 23 deletions

View File

@ -51,28 +51,31 @@ Hooks.on("chatMessage", (html, content, msg) => {
/* Additionnal hooks ready */ /* Additionnal hooks ready */
Hooks.once('ready', () => { Hooks.once('ready', () => {
game.packs.forEach((pack, idx) => { const lang = game.settings.get('core', 'language');
if(!pack.translated && pack.entity === 'Actor') { if ( lang == "fr" ) {
let translations = { game.packs.forEach((pack, idx) => {
"label": pack.metadata.name, if(!pack.translated && pack.entity === 'Actor') {
"mapping": { let translations = {
"name": "name", "label": pack.metadata.name,
"description": "details.biography.value", "mapping": {
"items": { "name": "name",
"path": "items", "description": "details.biography.value",
"converter": "bestiary_traits" "items": {
"path": "items",
"converter": "bestiary_traits"
},
"characteristics": {
"path": "data.characteristics",
"converter": "npc_characteristics"
}
}, },
"characteristics": { "entries": [
"path": "data.characteristics", ]
"converter": "npc_characteristics" };
} console.log("Actor compendium has been replaced !!!!");
}, game.packs[idx] = new TranslatedCompendium(pack, translations);
"entries": [ }
] } );
}; }
console.log("Actor compendium has been replaced !!!!");
game.packs[idx] = new TranslatedCompendium(pack, translations);
}
});
} ); } );

View File

@ -2,7 +2,7 @@
"name": "WH4-fr-translation", "name": "WH4-fr-translation",
"title": "Traduction du module WH4 en Français.", "title": "Traduction du module WH4 en Français.",
"description": "La traduction du module WH4.", "description": "La traduction du module WH4.",
"version": "0.64", "version": "0.65",
"minimumCoreVersion" : "0.5.1", "minimumCoreVersion" : "0.5.1",
"compatibleCoreVersion": "0.5.5", "compatibleCoreVersion": "0.5.5",
"author": "LeRatierBretonnien", "author": "LeRatierBretonnien",