From 4b2cb70034ef90cc259747969778ca9f1bab3fe1 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 31 Mar 2020 17:47:42 +0200 Subject: [PATCH] Add missing translated fields --- babele-register.js | 29 ----------------------------- compendium/wfrp4e.careers.json | 5 +---- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/babele-register.js b/babele-register.js index d983f70..356e9b0 100644 --- a/babele-register.js +++ b/babele-register.js @@ -68,35 +68,6 @@ Hooks.once('init', () => { } return talents_list; }, - "career_trappings": (trappings_list) => { - var compendium = game.packs.find(p => p.collection === 'wfrp4e.trappings'); - var i; - var len = trappings_list.length; - var re = /(.*)\((.*)\)/i; - for (i = 0; i < len; i++) { - var transl = compendium.i18nName( trappings_list[i] ); - if ( transl == trappings_list[i] ) { - var res = re.exec( trappings_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 ); - if (translw != transl) { - var res2 = re.exec(translw); - transl = res2[1] + "(" + subword + ")"; - } else { - s1 = res[1].trim() + " ( )"; - translw = compendium.i18nName( s1 ); - var res2 = re.exec(translw); - transl = res2[1] + "(" + subword + ")"; - } - } - } - trappings_list[i] = transl; - } - return trappings_list; - }, // To avoid duplicateing class for all careers "generic_localization": (value) => { return game.i18n.localize( value.trim() ); diff --git a/compendium/wfrp4e.careers.json b/compendium/wfrp4e.careers.json index 9a9c5e3..7210322 100644 --- a/compendium/wfrp4e.careers.json +++ b/compendium/wfrp4e.careers.json @@ -17,10 +17,7 @@ "path": "data.careergroup.value", "converter": "generic_localization" }, - "trappings": { - "path": "data.trappings", - "converter": "career_trappings" - } + "trappings": data.trappings.value }, "entries": [ {