config-patch WIP

This commit is contained in:
2025-05-08 21:38:19 +02:00
parent 1d166df55c
commit 881ca2f6e5
33 changed files with 190 additions and 189 deletions
+11 -11
View File
@@ -391,8 +391,8 @@ Hooks.on('ready', () => {
if (game.user.isGM) {
game.wfrp4e.warnDialog = new Dialog({
title: "Übersetzung laden - Danke fürs Warten",
content: `<img src="modules/wh4-de-translation/images/warhammer-v1-logo.webp"><p class="wfrp4-fr-message">
Die Diener Sigmars der Risikogruppe bereiten zusammen mit den bretonischen Rattenfängern die Übersetzung dieser Welt vor...</h3> <p class="wfrp4-fr-message">Bitte warte , bis diese Nachricht verschwunden ist, bevor du dich im Reich bewegst.</p><p class="wfrp4-fr-message">Wenn ein Segen von Shallya im Chat erscheint, ist alles gut gelaufen.</p>
content: `<img src="modules/wh4-de-translation/images/warhammer-v1-logo.webp"><p >
Die Diener Sigmars der Risikogruppe bereiten zusammen mit den bretonischen Rattenfängern die Übersetzung dieser Welt vor...</h3> <p >Bitte warte , bis diese Nachricht verschwunden ist, bevor du dich im Reich bewegst.</p><p >Wenn ein Segen von Shallya im Chat erscheint, ist alles gut gelaufen.</p>
Les moines de l'ordre de l'Enclume, associés aux légistes de Talabaheim, préparent la traduction Bretonnienne de ce monde...<p >Merci d'attendre la disparition de ce message pour vaquer dans l'Empire.</p> <p>Si une bénédiction de Shallya apparait dans le tchat, c'est que tout s'est bien passé.</p>`,
buttons: {
}
@@ -425,16 +425,16 @@ Hooks.on('ready', () => {
}
game.wfrp4e.config.difficultyLabels = {
"veasy": "Très Facile (+60)",
"easy": "Facile (+40)",
"veasy": "Sehr leicht (+60)",
"easy": "Leicht (+40)",
"banal": "Banal (+30)",
"average": "Accessible (+20)",
"medium": "Faisable (+10)",
"challenging": "Intermédiaire (+0)",
"difficult": "Complexe (-10)",
"hard": "Difficile (-20)",
"vhard": "Très Difficile (-30)",
"doom": "Maudit (-40)"
"average": "Durchschnittlich (+20)",
"medium": "Machbar (+10)",
"challenging": "Herausfordernd (+0)",
"difficult": "Schwierig (-10)",
"hard": "Schwer (-20)",
"vhard": "Sehr schwer (-30)",
"doom": "Unmöglich (-40)"
}
game.wfrp4e.warnDialog.render(true, {focus: true, left: 20, top: 20});
+56 -56
View File
@@ -23,16 +23,14 @@ const vo_conditions = {
}
const __SELECT_BONUS_PREFIX_D = {
"initiative": 1,
"intelligence": 1,
"endurance": 1,
"agilite": 1,
"agilité": 1
"widerstand": 1,
"gewandheit": 1,
"geschicklichkeit": 1
}
/************************************************************************************/
export class WFRP4FrTranslation {
static parseSpellContent(spell) {
if (spell.system.range?.value) {
spell.system.range.value = this.processSpellContent(spell.system.range.value)
@@ -43,10 +41,10 @@ export class WFRP4FrTranslation {
if (spell.system.duration?.value) {
spell.system.duration.value = this.processSpellContent(spell.system.duration?.value)
}
if ( spell.system.range?.value) {
if (spell.system.range?.value) {
spell.system.range.value = this.processSpellContent(spell.system.range?.value)
}
if (spell.system.target?.value ) {
if (spell.system.target?.value) {
spell.system.target.value = this.processSpellContent(spell.system.target?.value)
}
}
@@ -54,9 +52,9 @@ export class WFRP4FrTranslation {
static processSpellContent(value) {
//console.log("Spell duration/range/damage/target :", value);
if (value == "") return ""; // Hop !
if (value == "Touch") return "Contact"; // Hop !
if (value == "You") return "Vous"; // Hop !
if (value == "Instant") return "Instantané"; // Hop !
if (value == "Touch") return "Berührung"; // Hop !
if (value == "You") return "Du"; // Hop !
if (value == "Instant") return "Sofort"; // Hop !
let translw = value;
let re = /(.*)\s+[Bb]onus\s*(\w*)/i;
let res = re.exec(value);
@@ -65,8 +63,10 @@ export class WFRP4FrTranslation {
if (res) { // Test "<charac> Bonus <unit>" pattern
if (res[1]) { // We have char name, then convert it
translw = game.i18n.localize(res[1].trim());
let bonusPrefix = (translw.toLowerCase() in __SELECT_BONUS_PREFIX_D) ? "Bonus d'" : "Bonus de ";
translw = bonusPrefix + translw
// let bonusPrefix = (translw.toLowerCase() in __SELECT_BONUS_PREFIX_D) ? "Bonus d'" : "Bonus de ";
// translw = bonusPrefix + translw
let bonusSufix = (translw.toLowerCase() in __SELECT_BONUS_PREFIX_D) ? "sbonus" : "bonus";
translw = translw + "bonusSufix"
}
unit = res[2];
} else {
@@ -84,14 +84,14 @@ export class WFRP4FrTranslation {
}
}
}
if (unit == "hour") unit = "heure";
if (unit == "hours") unit = "heures";
if (unit == "days") unit = "jours";
if (unit == "yard") unit = "mètre";
if (unit == "yards") unit = "mètres";
if (unit == "hour") unit = "stunde";
if (unit == "hours") unit = "stunden";
if (unit == "days") unit = "tage";
if (unit == "yard") unit = "meter";
if (unit == "yards") unit = "meter";
if (unit == "Bonus") { // Another weird management
console.log("Translating bonus", unit);
translw = "Bonus de " + translw;
translw = translw + " Bonus";
} else {
translw += " " + unit;
}
@@ -116,8 +116,8 @@ Hooks.once('init', () => {
game.wfrp4e.apps.StatBlockParser.parseStatBlock = async function (statString, type = "npc") {
return statParserFR(statString, type);
}
console.log("WFRP4E-FR | Loading Babele translation module ...");
console.log("WFRP4E-DE | Loading Babele translation module ...");
loadScripts();
/*---------------------------------------------------------------------*/
@@ -225,7 +225,7 @@ Hooks.once('init', () => {
lang: 'de',
dir: 'compendium'
},
)
)
game.babele.registerConverters({
@@ -258,7 +258,7 @@ Hooks.once('init', () => {
s1 = res[1].trim() + " ( )";
translItem = game.babele.translate(compData.metadata.id, { name: s1, type: "skill" }, true)
translw = translItem?.name || undefined
if(translw) {
if (translw) {
let res2 = re.exec(translw);
transl = res2[1] + "(" + subword + ")";
} else {
@@ -285,16 +285,16 @@ Hooks.once('init', () => {
for (let e of effectsData) {
let origName = e.name
e.name = tc_translations.name || game.i18n.localize(e.name)
if ( e.flags?.wfrp4e?.scriptData) {
if (e.flags?.wfrp4e?.scriptData) {
for (let script of e.flags.wfrp4e.scriptData) {
if (script?.label) {
// Quand le label du script est strictement identique au nom de l'item concerné
if ( script.label.toLowerCase() == origName.toLowerCase() ) {
script.label = e.name
if (script.label.toLowerCase() == origName.toLowerCase()) {
script.label = e.name
} else if (script.label.toLowerCase().includes("tests to affect")) {
script.label = script.label.replace("Tests to affect", "Tests relatifs à ")
script.label = script.label.replace("Tests to affect", "Würfe zum Beeinflussen von ")
} else if (script.label.toLowerCase().includes("using torn muscle")) {
script.label = script.label.replace("Using Torn Muscle", "Utilisation du muscle déchiré ")
script.label = script.label.replace("Using Torn Muscle", "Verwende gerissenen Muskel ")
} else {
script.label = game.i18n.localize(script.label)
}
@@ -360,8 +360,8 @@ Hooks.once('init', () => {
for (let compData of validCompendiums) {
let translItem = game.babele.translate(compData.metadata.id, { name: talents_list[i] }, true);
// Specific case management
if (talents_list[i] === "Trapper") {
translItem = game.babele.translate(compData.metadata.id, { name: "a7v422EZcOUUC20X" }, true);
if (talents_list[i] === "Trapper") {
translItem = game.babele.translate(compData.metadata.id, { name: "a7v422EZcOUUC20X" }, true);
}
//console.log("Search talent name:", compData.metadata.id, talents_list[i], translItem);
let transl = translItem?.name || undefined
@@ -480,7 +480,7 @@ Hooks.once('init', () => {
let validCompendiums = game.wfrp4e.tags.getPacksWithTag("spell")
for (let compData of validCompendiums) {
let trait_fr = game.babele.translate(compData.metadata.id, { name: name_en }, true)
if (trait_fr?.system) {
if (trait_fr?.system) {
//DEBUG : console.log(">>>>> Spell ?", name_en, special, trait_fr);
WFRP4FrTranslation.parseSpellContent(trait_en)
trait_fr.name = trait_fr.name || name_en
@@ -591,7 +591,7 @@ Hooks.once('init', () => {
"career_careergroup": (value) => {
// Manage exception - Dirty hack
if (value == 'Slayer') {
return "Tueur";
return "Slayer";
}
if (value == 'Druidic Priest') {
return "Druide";
@@ -604,7 +604,7 @@ Hooks.once('init', () => {
if (!newName) newName = value
return newName
}
ui.notifications.error("Impossible de trouver la carrière " + value + ". Elle n'est probablement pas traduite.", { permanent: true })
ui.notifications.error("Das Übersetzen der Karriere " + value + " ist nicht möglich. Sie ist wahrscheinlich nicht übersetzt.", { permanent: true })
return value
},
@@ -612,29 +612,29 @@ Hooks.once('init', () => {
//console.log("Parsing mutation :", value);
if (!value) return;
value = value.toLowerCase();
value = value.replace("gain a broken condition if you fail a test derived from ", "Gagnez un état Brisé si vous échouez à un test dérivé de ");
value = value.replace("weapon skill", "Capacité de Combat");
value = value.replace("ballistic skill", "Capacité de Tir");
value = value.replace("strength", "Force");
value = value.replace("toughness", "Endurance");
value = value.replace("agility", "Agilité");
value = value.replace("dexterity", "Dextérité");
value = value.replace("willpower", "Force Mentale");
value = value.replace("fellowship", "Sociabilité");
value = value.replace("gain a broken condition if you fail a test derived from ", "Du erhälst einen Demoralisiert-Zustand wenn dir ein Wurf misslingt in ");
value = value.replace("weapon skill" ,"Kampfgeschick");
value = value.replace("ballistic skill", "Ballisitsche Fertigkeit");
value = value.replace("strength", "Stärke");
value = value.replace("toughness", "Widerstand");
value = value.replace("agility", "Gewandheit");
value = value.replace("dexterity", "Geschicklichkeit");
value = value.replace("willpower", "Willenskraft");
value = value.replace("fellowship", "Charisma");
value = value.replace("initiative", "Initiative");
value = value.replace("intelligence", "Intelligence");
value = value.replace("armor points to the head", "PA à la Tête");
value = value.replace("subject to frenzy", "Sujet à la Frénésie");
value = value.replace("you do not scar", "Aucune cicatrice");
value = value.replace("movement", "Mouvement");
value = value.replace("armor points to all locations", "PA sur tout le corps");
value = value.replace("to any test when alone", "à tout les tests lorsque seul");
value = value.replace("track", "Pistage");
value = value.replace("to any test not hurting another", "à tout les Tests n'aggressant pas autrui");
value = value.replace("on tests to hurt", "pour les tests impliquant une agression")
value = value.replace("to all language tests when speaking", "à tout les Tests de Langue lorsque vous parlez");
value = value.replace("on perception tests involving sight", "aux Tests de Perception impliquant la Vue");
value = value.replace("to all Sociabilité tests", "à tout les Tests de Sociabilité");
value = value.replace("intelligence", "Intelligenz");
value = value.replace("armor points to the head", "RP am Kopf");
value = value.replace("subject to frenzy", "unterliegt Raserei");
value = value.replace("you do not scar", "Du bildest keine Narben");
value = value.replace("movement", "Bewegung");
value = value.replace("armor points to all locations", "RP am ganzen Körper");
value = value.replace("to any test when alone", "auf jeden Wurf, wenn du alleine bsit");
value = value.replace("track", "Spurenlesen");
value = value.replace("to any test not hurting another", "auf jeden Wurf, um anderen keine Schmerzen zuzufügen");
value = value.replace("on tests to hurt", "auf jeden Wurf, um anderen Schmerzen zuzufügen")
value = value.replace("to all language tests when speaking", "auf alle Sprache-Würfe beim Sprechen");
value = value.replace("on perception tests involving sight", "auf Wahrnehmungs-Würfe, bei denen es um die Sicht geht");
value = value.replace("to all Sociabilité tests", "auf alle gesellschaftlichen Würfe");
return value;
},
"talent_name": (name, translation) => {
@@ -673,7 +673,7 @@ Hooks.once('init', () => {
"disease_duration_unit": (unit) => {
return game.i18n.localize(unit).capitalize();
}
});
});
}
});
+53 -53
View File
@@ -105,9 +105,9 @@ export class WH4FRPatchConfig {
for ( let key in row) {
if (key != "range") {
if ( row[key].name == 'Slayer' ) {
row[key].name = "Tueur Nains";
row[key].name = "Slayer";
} else if ( row[key].name == 'Duelist' ) {
row[key].name = "Duelliste";
row[key].name = "Duellist";
//console.log(">>>>> Career ?", key, row[key].name, career_fr.name );
} else {
let career_fr = game.babele.translate( compendiumName, {name: row[key].name}, true );
@@ -125,7 +125,7 @@ export class WH4FRPatchConfig {
if (game.user.isGM) {
let coreC7 = game.modules.find(mod => mod.id == "wfrp4e-core")
if (!coreC7 || !coreC7.active) {
ui.notifications.warn("Vous n'avez pas activé le module CoreC7 ! La traduction sera donc incomplète et inopérante.")
ui.notifications.warn("Du hast das Core-Modul nicht aktiviert! Die Übersetzung wird daher unvollständig und unwirksam sein.")
return
}
}
@@ -135,52 +135,52 @@ export class WH4FRPatchConfig {
game.wfrp4e.config.qualityDescriptions["distract"] = game.i18n.localize("WFRP4E.Properties.Distract"); // Patch missing quality
game.wfrp4e.config.talentBonuses = {
"perspicace": "int",
"affable": "fel",
"tireur de précision": "bs",
"très fort": "s",
"vivacité": "i",
"reflexes foudroyants": "ag",
"imperturbable": "wp",
"très résistant": "t",
"doigts de fée": "dex",
"guerrier né": "ws"
"gerissenheit": "int",
"einnehmendes wesen": "fel",
"meisterschütze": "bs",
"sehr stark": "s",
"aufgeweckt": "i",
"blitzschnelle reflexe": "ag",
"kühler kopf": "wp",
"unverwüstlich": "t",
"geschickte finger": "dex",
"geborener krieger": "ws"
}
if (game.wfrp4e.config.loreEffects) {
game.wfrp4e.config.loreEffects["beasts"].label = "Domaine des Bêtes"
game.wfrp4e.config.loreEffects["death"].label = "Domaine de la Mort"
game.wfrp4e.config.loreEffects["fire"].label = "Domaine du Feu"
game.wfrp4e.config.loreEffects["metal"].label = "Domaine du Métal"
game.wfrp4e.config.loreEffects["heavens"].label = "Domaine des Cieux"
game.wfrp4e.config.loreEffects["life"].label = "Domaine de la Vie"
game.wfrp4e.config.loreEffects["light"].label = "Domaine de la Lumière"
game.wfrp4e.config.loreEffects["shadow"].label = "Domaine des Ombres"
game.wfrp4e.config.loreEffects["hedgecraft"].label = "Domaine de la Magie de Village"
game.wfrp4e.config.loreEffects["hedgecraft"].label = "Domaine de la Sorcellerie"
game.wfrp4e.config.loreEffects["beasts"].label = "Lehre der Bestien"
game.wfrp4e.config.loreEffects["death"].label = "Lehre des Todes"
game.wfrp4e.config.loreEffects["fire"].label = "Lehre des Feuers"
game.wfrp4e.config.loreEffects["metal"].label = "Lehre des Metalls"
game.wfrp4e.config.loreEffects["heavens"].label = "Lehre des Himmels"
game.wfrp4e.config.loreEffects["life"].label = "Lehre des Lebens"
game.wfrp4e.config.loreEffects["light"].label = "Lehre des Lichts"
game.wfrp4e.config.loreEffects["shadow"].label = "Lehre der SChatten"
game.wfrp4e.config.loreEffects["hedgecraft"].label = "Lehre der Heckenzauberei"
game.wfrp4e.config.loreEffects["hedgecraft"].label = "Lehre der Heckenzauberei"
}
if (game.wfrp4e.config.species) {
game.wfrp4e.config.species["human"] = "Humain";
game.wfrp4e.config.species["dwarf"] = "Nain";
game.wfrp4e.config.species["halfling"] = "Halfling";
game.wfrp4e.config.species["helf"] = "Haut Elfe";
game.wfrp4e.config.species["welf"] = "Elfe Sylvain";
game.wfrp4e.config.species["human"] = "Mensch";
game.wfrp4e.config.species["dwarf"] = "Zwerg";
game.wfrp4e.config.species["halfling"] = "Halbling";
game.wfrp4e.config.species["helf"] = "Hochelf";
game.wfrp4e.config.species["welf"] = "Waldelf";
}
if (game.wfrp4e.config.charastericticsBonus) {
game.wfrp4e.config.charastericticsBonus =
{
"ws": "Bonus de Capacité de Combat",
"bs": "Bonus de Capacité de Tir",
"s": "Bonus de Force",
"t": "Bonus d'Endurance",
"i": "Bonus d'Initiative",
"ag": "Bonus d'Agilité",
"dex": "Bonus de Dexterité",
"int": "Bonus d'Intelligence",
"wp": "Bonus de Force Mentale",
"fel": "Bonus de Sociabilité"
"ws": "Kampfgeschickbonus",
"bs": "Ballistische Fähigkeit Bonus",
"s": "Stärkebonus",
"t": "Widerstandsbonus",
"i": "Initiativebonus",
"ag": "Gewandheitsbonus",
"dex": "Geschicklichkeitsbonus",
"int": "Intelligenzbonus",
"wp": "Willenskraftbonus",
"fel": "Charismabonus"
}
}
@@ -1006,9 +1006,9 @@ export class WH4FRPatchConfig {
"symptom": true,
"script": `
let difficulty = ""
if (this.effect.label.includes("Modéré"))
if (this.effect.label.includes("moderat"))
difficulty = "easy"
else if (this.effect.label.includes("Sévère"))
else if (this.effect.label.includes("schwerwiegend"))
difficulty = "average"
else
difficulty = "veasy"
@@ -1027,7 +1027,7 @@ export class WH4FRPatchConfig {
}
},
"buboes": {
label: "Bubons",
label: "Beulen",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1053,7 +1053,7 @@ export class WH4FRPatchConfig {
}
},
"convulsions": {
label: "Convulsions",
label: "Krämpfe",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1063,7 +1063,7 @@ export class WH4FRPatchConfig {
"symptom": true,
"script": `
let modifier = 0
if (this.effect.label.includes("Modéré"))
if (this.effect.label.includes("moderat"))
modifier = -20
else
modifier = -10
@@ -1086,7 +1086,7 @@ export class WH4FRPatchConfig {
}
},
"fever": {
label: "Fièvre",
label: "Fieber",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1115,7 +1115,7 @@ export class WH4FRPatchConfig {
}
},
"flux": {
label: "Intoxication Alimentaire",
label: "Durchfall",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1125,7 +1125,7 @@ export class WH4FRPatchConfig {
}
},
"lingering": {
label: "Persistant",
label: "Langanhaltend",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1135,7 +1135,7 @@ export class WH4FRPatchConfig {
}
},
"coughsAndSneezes": {
label: "Toux et éternuements",
label: "Husten und Niesen",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1145,7 +1145,7 @@ export class WH4FRPatchConfig {
}
},
"gangrene": {
label: "Gangrène",
label: "Wundbrand",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1169,7 +1169,7 @@ export class WH4FRPatchConfig {
}
},
"malaise": {
label: "Malaise",
label: "Unwohlsein",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1184,7 +1184,7 @@ export class WH4FRPatchConfig {
if (!fatigued)
{
args.actor.addCondition("fatigued")
ui.notifications.notify("Etat Extenué ajouté à " + args.actor.name + ", qui ne peut pas être enlevé tant que le symptôme Malaise est présent.")
ui.notifications.notify("Zustand Erschöpft zu " + args.actor.name + " hinzugefügt, das nicht entfernt werden kann, solange das Symptom Unwohlsein vorhanden ist.")
}
}
`
@@ -1192,7 +1192,7 @@ export class WH4FRPatchConfig {
}
},
"nausea": {
label: "Nausée",
label: "Übelkeit",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1217,7 +1217,7 @@ export class WH4FRPatchConfig {
}
},
"pox": {
label: "Démangeaisons",
label: "Pocken",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
@@ -1239,7 +1239,7 @@ export class WH4FRPatchConfig {
}
},
"wounded": {
label: "Blessé",
label: "Offene Wunde",
icon: "modules/wfrp4e-core/icons/diseases/disease.png",
transfer: true,
flags: {
File diff suppressed because one or more lines are too long