From 406ed0892587bdf66f97eb88cbea53e734dc42a7 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 14 Apr 2020 17:16:25 +0200 Subject: [PATCH] Sync to v1.2 WH4 --- babele-register.js | 17 +++++++++-------- module.json | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/babele-register.js b/babele-register.js index 8c44317..a11fe44 100644 --- a/babele-register.js +++ b/babele-register.js @@ -175,26 +175,27 @@ Hooks.once('init', () => { Babele.get().registerConverters({ "career_skills": (skills_list) => { - //console.log( "Thru here ..." ); var compendium = game.packs.find(p => p.collection === 'wfrp4e.skills'); + //console.log( "Thru here ...", compendium, skills_list); var i; var len = skills_list.length; var re = /(.*)\((.*)\)/i; for (i = 0; i < len; i++) { - var transl = compendium.i18nName( skills_list[i] ); + var transl = compendium.i18nName( { name: skills_list[i] } ); + //console.log("List ...", skills_list[i]); if ( transl == skills_list[i] ) { var res = re.exec( skills_list[i]); if (res) { //console.log("Matched/split:", res[1], res[2]); var subword = game.i18n.localize(res[2].trim() ); var s1 = res[1].trim() + " ()"; - var translw = compendium.i18nName( s1 ); + var translw = compendium.i18nName( { name: s1} ); if (translw != s1) { var res2 = re.exec(translw); transl = res2[1] + "(" + subword + ")"; } else { s1 = res[1].trim() + " ( )"; - translw = compendium.i18nName( s1 ); + translw = compendium.i18nName( { name: s1} ); var res2 = re.exec(translw); transl = res2[1] + "(" + subword + ")"; } @@ -210,19 +211,19 @@ Hooks.once('init', () => { var len = talents_list.length; var re = /(.*)\((.*)\)/i; for (i = 0; i < len; i++) { - var transl = compendium.i18nName( talents_list[i] ); + var transl = compendium.i18nName( { name: talents_list[i]} ); if ( transl == talents_list[i] ) { var res = re.exec( talents_list[i]); if (res) { //console.log("Matched/split:", res[1], res[2]); var subword = game.i18n.localize(res[2].trim() ); var s1 = res[1].trim(); // No () in talents table - var translw = compendium.i18nName( s1 ); + var translw = compendium.i18nName( { name: s1 } ); if (translw != s1) { transl = translw + "(" + subword + ")"; } else { s1 = res[1].trim() + " ( )"; - translw = compendium.i18nName( s1 ); + translw = compendium.i18nName( { name: s1 } ); var res2 = re.exec(translw); transl = res2[1] + "(" + subword + ")"; } @@ -257,7 +258,7 @@ Hooks.once('init', () => { // Search back in careers the translated name of the groupe (as it is the name of the level career itself) "career_careergroup": (value) => { var compendium = game.packs.find(p => p.collection === 'wfrp4e.careers'); - return compendium.i18nName( value ); + return compendium.i18nName( { name: value } ); }, // Auto-translate duration "spells_duration_range_target_damage": (value) => { diff --git a/module.json b/module.json index 264d5bb..dbc78e3 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "name": "WH4-fr-translation", "title": "Traduction du module WH4 en Français.", "description": "La traduction du module WH4.", - "version": "0.49", + "version": "0.50", "minimumCoreVersion" : "0.5.1", "compatibleCoreVersion": "0.5.4", "author": "LeRatierBretonnien",