Fix pour version Babele v1.27

This commit is contained in:
sladecraven 2021-05-02 14:05:39 +02:00
parent 1a781f106f
commit e78938ce68
2 changed files with 8 additions and 8 deletions

View File

@ -214,7 +214,7 @@ Hooks.once('init', () => {
var re = /(.*)\((.*)\)/i;
for (i = 0; i < len; i++) {
skills_list[i] = skills_list[i].trim();
var transl = compendium.i18nName( { name: skills_list[i] } );
var transl = compendium.translate( { name: skills_list[i] } ).name;
//console.log("List ...", skills_list[i]);
if ( transl == skills_list[i] ) {
var res = re.exec( skills_list[i] );
@ -222,13 +222,13 @@ Hooks.once('init', () => {
//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( { name: s1} );
var translw = compendium.translate( { name: s1} ).name;
if (translw != s1) {
var res2 = re.exec(translw);
transl = res2[1] + "(" + subword + ")";
} else {
s1 = res[1].trim() + " ( )";
translw = compendium.i18nName( { name: s1} );
translw = compendium.translate( { name: s1} ).name;
var res2 = re.exec(translw);
transl = res2[1] + "(" + subword + ")";
}
@ -257,19 +257,19 @@ Hooks.once('init', () => {
var len = talents_list.length;
var re = /(.*)\((.*)\)/i;
for (i = 0; i < len; i++) {
var transl = compendium.i18nName( { name: talents_list[i]} );
var transl = compendium.translate( { name: talents_list[i]} ).name;
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( { name: s1 } );
var translw = compendium.translate( { name: s1 } ).name;
if (translw != s1) {
transl = translw + "(" + subword + ")";
} else {
s1 = res[1].trim() + " ( )";
translw = compendium.i18nName( { name: s1 } );
translw = compendium.translate( { name: s1 } ).name;
var res2 = re.exec(translw);
transl = res2[1] + "(" + subword + ")";
}
@ -449,7 +449,7 @@ Hooks.once('init', () => {
// Per default
var compendium = game.packs.find(p => p.collection === compmod+'.careers');
if ( compendium )
return compendium.i18nName( { name: value } );
return compendium.translate( { name: value } ).name;
else
ui.notifications.error("Impossible de trouver la carrière " + value + ". Elle n'est probablement pas traduite.", { permanent: true })
},

View File

@ -3,7 +3,7 @@
"name": "WH4-fr-translation",
"title": "Traduction du module WH4 en Français.",
"description": "La traduction du module WH4.",
"version": "1.5.7",
"version": "1.5.8",
"minimumCoreVersion" : "0.7.1",
"compatibleCoreVersion": "0.7.9",
"author": "LeRatierBretonnien",