From b579e3f9c33f38e8ca919fce9514219f6c4e551f Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sun, 28 Mar 2021 18:33:31 +0200 Subject: [PATCH] =?UTF-8?q?Traduction=20compl=C3=A9mentaires=20pouvoirs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swade-core-rules.swade-powers.json | 14 ++++++- module/modules/swade-fr-init.js | 37 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/module/compendiums/swade-core-rules.swade-powers.json b/module/compendiums/swade-core-rules.swade-powers.json index 4ff2801..17b03cd 100644 --- a/module/compendiums/swade-core-rules.swade-powers.json +++ b/module/compendiums/swade-core-rules.swade-powers.json @@ -2,7 +2,19 @@ "label": "SWADE Pouvoirs", "mapping": { "description_full": "data.description", - "trapping": "data.trapping" + "trapping": "data.trapping", + "duration": { + "path": "data.duration", + "converter": "powers_duration" + }, + "range": { + "path": "data.range", + "converter": "powers_range" + }, + "rank": { + "path": "data.rank", + "converter": "powers_rank" + } }, "entries": [ { diff --git a/module/modules/swade-fr-init.js b/module/modules/swade-fr-init.js index f7a9d0d..5da3571 100644 --- a/module/modules/swade-fr-init.js +++ b/module/modules/swade-fr-init.js @@ -1,6 +1,7 @@ /************************************************************************************/ Hooks.once('init', () => { + if(typeof Babele !== 'undefined') { console.log("BABELE LOADED !!!"); @@ -9,6 +10,42 @@ Hooks.once('init', () => { lang: 'fr', dir: 'compendiums' }); + + Babele.get().registerConverters({ + "powers_duration": (duration) => { + if ( duration == 'One hour') return 'Une heure'; + if ( duration == 'Instant (slot); 5 (speed)') return 'Instantané (apathie); 5 (vitesse)'; + if ( duration == '(boost); Instant (lower)') return '5 (augmentation); Instantané (diminution)'; + if ( duration == 'Instant') return 'Instantanné'; + if ( duration == 'Until the end of the victim\'s next turn') return 'Jusqu`à la fin du prochain tour de la cible'; + if ( duration == 'A brief conversation of about five minutes') return 'Une brève conversation d\'environ 5 minutes'; + if ( duration == '5 (detect), one hour (conceal)') return '5 (détection); une heure (dissimulation)'; + if ( duration == 'Instant (Sound); 5 (Silence)') return 'Instantané (Son); 5 (Silence)'; + return duration; + }, + "powers_range": (range) => { + if ( range == 'Smarts x5 (Sound); Smarts (Silence)') + return 'Intellect x5 (Son); Intellect (Silence)'; + if ( range == "Cone Template") + return "Cône" + if ( range == "Touch") + return "Toucher" + if ( range == "Sm") + return "Ame mètres" + if ( range == "Sm x 2" || range == "Sm x2") + return "Ame mètres x 2" + if ( range == "Self") + return "Soi-même" + return range; + }, + "powers_rank": (rank) => { + if ( rank == 'Novice') return 'Novice'; + if ( rank == 'Seasoned') return 'Aguerri'; + if ( rank == 'Veteran') return 'Vétéran'; + if ( rank == 'Heroic') return 'Héroïque'; + return rank; + } + } ); } });