Fix pour version Babele v1.27
This commit is contained in:
parent
1a781f106f
commit
e78938ce68
@ -214,7 +214,7 @@ Hooks.once('init', () => {
|
|||||||
var re = /(.*)\((.*)\)/i;
|
var re = /(.*)\((.*)\)/i;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
skills_list[i] = skills_list[i].trim();
|
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]);
|
//console.log("List ...", skills_list[i]);
|
||||||
if ( transl == skills_list[i] ) {
|
if ( transl == skills_list[i] ) {
|
||||||
var res = re.exec( 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]);
|
//console.log("Matched/split:", res[1], res[2]);
|
||||||
var subword = game.i18n.localize(res[2].trim() );
|
var subword = game.i18n.localize(res[2].trim() );
|
||||||
var s1 = res[1].trim() + " ()";
|
var s1 = res[1].trim() + " ()";
|
||||||
var translw = compendium.i18nName( { name: s1} );
|
var translw = compendium.translate( { name: s1} ).name;
|
||||||
if (translw != s1) {
|
if (translw != s1) {
|
||||||
var res2 = re.exec(translw);
|
var res2 = re.exec(translw);
|
||||||
transl = res2[1] + "(" + subword + ")";
|
transl = res2[1] + "(" + subword + ")";
|
||||||
} else {
|
} else {
|
||||||
s1 = res[1].trim() + " ( )";
|
s1 = res[1].trim() + " ( )";
|
||||||
translw = compendium.i18nName( { name: s1} );
|
translw = compendium.translate( { name: s1} ).name;
|
||||||
var res2 = re.exec(translw);
|
var res2 = re.exec(translw);
|
||||||
transl = res2[1] + "(" + subword + ")";
|
transl = res2[1] + "(" + subword + ")";
|
||||||
}
|
}
|
||||||
@ -257,19 +257,19 @@ Hooks.once('init', () => {
|
|||||||
var len = talents_list.length;
|
var len = talents_list.length;
|
||||||
var re = /(.*)\((.*)\)/i;
|
var re = /(.*)\((.*)\)/i;
|
||||||
for (i = 0; i < len; 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] ) {
|
if ( transl == talents_list[i] ) {
|
||||||
var res = re.exec( talents_list[i]);
|
var res = re.exec( talents_list[i]);
|
||||||
if (res) {
|
if (res) {
|
||||||
//console.log("Matched/split:", res[1], res[2]);
|
//console.log("Matched/split:", res[1], res[2]);
|
||||||
var subword = game.i18n.localize(res[2].trim() );
|
var subword = game.i18n.localize(res[2].trim() );
|
||||||
var s1 = res[1].trim(); // No () in talents table
|
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) {
|
if (translw != s1) {
|
||||||
transl = translw + "(" + subword + ")";
|
transl = translw + "(" + subword + ")";
|
||||||
} else {
|
} else {
|
||||||
s1 = res[1].trim() + " ( )";
|
s1 = res[1].trim() + " ( )";
|
||||||
translw = compendium.i18nName( { name: s1 } );
|
translw = compendium.translate( { name: s1 } ).name;
|
||||||
var res2 = re.exec(translw);
|
var res2 = re.exec(translw);
|
||||||
transl = res2[1] + "(" + subword + ")";
|
transl = res2[1] + "(" + subword + ")";
|
||||||
}
|
}
|
||||||
@ -449,7 +449,7 @@ Hooks.once('init', () => {
|
|||||||
// Per default
|
// Per default
|
||||||
var compendium = game.packs.find(p => p.collection === compmod+'.careers');
|
var compendium = game.packs.find(p => p.collection === compmod+'.careers');
|
||||||
if ( compendium )
|
if ( compendium )
|
||||||
return compendium.i18nName( { name: value } );
|
return compendium.translate( { name: value } ).name;
|
||||||
else
|
else
|
||||||
ui.notifications.error("Impossible de trouver la carrière " + value + ". Elle n'est probablement pas traduite.", { permanent: true })
|
ui.notifications.error("Impossible de trouver la carrière " + value + ". Elle n'est probablement pas traduite.", { permanent: true })
|
||||||
},
|
},
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "WH4-fr-translation",
|
"name": "WH4-fr-translation",
|
||||||
"title": "Traduction du module WH4 en Français.",
|
"title": "Traduction du module WH4 en Français.",
|
||||||
"description": "La traduction du module WH4.",
|
"description": "La traduction du module WH4.",
|
||||||
"version": "1.5.7",
|
"version": "1.5.8",
|
||||||
"minimumCoreVersion" : "0.7.1",
|
"minimumCoreVersion" : "0.7.1",
|
||||||
"compatibleCoreVersion": "0.7.9",
|
"compatibleCoreVersion": "0.7.9",
|
||||||
"author": "LeRatierBretonnien",
|
"author": "LeRatierBretonnien",
|
||||||
|
Loading…
Reference in New Issue
Block a user