Babele management fix for talents/traits

This commit is contained in:
sladecraven 2022-10-18 09:30:30 +02:00
parent 0f09baa7fe
commit d9a6c7c179
2 changed files with 7 additions and 6 deletions

View File

@ -334,12 +334,13 @@ Hooks.once('init', () => {
special = " (" + game.i18n.localize( res[2].trim() ) + ")"; // And the special keyword
}
var trait_fr = game.babele.translate( compmod+'.talents', { name: name_en }, true )
trait_fr.name = trait_fr.name || name_en
trait_fr.name = trait_fr.name || name_en // Security since babele v10
//console.log(">>>>> Talent ?", trait_fr, name_en, special, trait_fr.name);
if ( trait_fr.name != "Sprinter" && trait_fr.name == name_en) { // If no translation, test ugtalents
trait_fr = game.babele.translate( 'wfrp4e-unofficial-grimoire.ug-careerstalentstraits', { name: name_en }, true );
trait_fr.name = trait_fr.name || name_en // Security since babele v10
}
if ( trait_fr.name == "Sprinter" || trait_fr.name != name_en) { // Talent translated!
if ( trait_fr.name && (trait_fr.name == "Sprinter" || trait_fr.name != name_en)) { // Talent translated!
trait_en.name = trait_fr.name.trim() + special
if ( trait_fr.system ) { // Why ???
trait_en.system.description.value = trait_fr.system.description.value;
@ -348,7 +349,7 @@ Hooks.once('init', () => {
} else if ( trait_en.type == "career") {
var career_fr = game.babele.translate( compmod+'.careers', trait_en, true );
career_fr.name = career_fr.name || trait_en.name
console.log(">>>>> Career ?", career_fr.name );
//console.log(">>>>> Career ?", career_fr.name );
trait_en.system = duplicate(career_fr.system);
} else if ( trait_en.type == "trapping" || trait_en.type == "weapon" || trait_en.type == "armour" || trait_en.type == "container" || trait_en.type == "money") {

View File

@ -8,7 +8,7 @@
}
],
"url": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr",
"version": "6.2.10",
"version": "6.2.11",
"esmodules": [
"babele-register.js",
"addon-register.js",
@ -136,11 +136,11 @@
}
],
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/raw/v10/module.json",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/archive/foundryvtt-wh4-lang-fr-6.2.10.zip",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/archive/foundryvtt-wh4-lang-fr-6.2.11.zip",
"id": "wh4-fr-translation",
"compatibility": {
"minimum": "10",
"verified": "10.286"
"verified": "10"
},
"relationships": {
"systems": [