fix(i18n): localisation des notifications et messages d'erreur du système
This commit is contained in:
@@ -84,8 +84,8 @@ export class BoLHordeSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
Dialog.confirm({
|
||||
title: "Suppression",
|
||||
content: `Vous êtes sûr de vouloir supprimer cet item ?`,
|
||||
title: game.i18n.localize("BOL.ui.deletetitle"),
|
||||
content: game.i18n.localize("BOL.ui.confirmdelete"),
|
||||
yes: () => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteEmbeddedDocuments("Item", [li.data("itemId")])
|
||||
|
||||
@@ -94,8 +94,8 @@ export class BoLVehicleSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
Dialog.confirm({
|
||||
title: "Suppression",
|
||||
content: `Vous êtes sûr de vouloir supprimer cet item ?`,
|
||||
title: game.i18n.localize("BOL.ui.deletetitle"),
|
||||
content: game.i18n.localize("BOL.ui.confirmdelete"),
|
||||
yes: () => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteEmbeddedDocuments("Item", [li.data("itemId")])
|
||||
|
||||
+3
-2
@@ -121,12 +121,13 @@ async function welcomeMessage() {
|
||||
ChatMessage.create({ user: game.user.id, whisper: [game.user.id], content })
|
||||
|
||||
if (game.user.isGM && game.i18n.lang == 'en' && !game.modules.get("babele")?.active) {
|
||||
const babeleWarning = game.i18n.localize("BOL.chat.babelewarning")
|
||||
ChatMessage.create({
|
||||
user: game.user.id,
|
||||
whisper: [game.user.id],
|
||||
content: `<div class="bol-welcome-card"><div class="welcome-body"><p class="welcome-warning">⚠ WARNING ! English language selected, but Babele module is not installed !<br>Please install babele from the module tab in Foundry interface.</p></div></div>`
|
||||
content: `<div class="bol-welcome-card"><div class="welcome-body"><p class="welcome-warning">${babeleWarning}</p></div></div>`
|
||||
})
|
||||
ui.notifications.warn("WARNING ! English language selected, but babele module is not installed !<br>Please install babele from the module tab in Foundry interface.")
|
||||
ui.notifications.warn(babeleWarning)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ export class BoLRoll {
|
||||
// Manage specific case
|
||||
let fightOption = actor.getActiveFightOption()
|
||||
if (fightOption && fightOption.system.properties.fightoptiontype == "fulldefense") {
|
||||
ui.notifications.warn(`{{actor.name}} est en Défense Totale ! Il ne peut pas attaquer ce round.`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.FullDefense", { actor: actor.name }))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ export class BoLRoll {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let weapon = actor.items.get(li.data("item-id"))
|
||||
if (!weapon) {
|
||||
ui.notifications.warn("Unable to find weapon !")
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.WeaponNotFound"))
|
||||
return
|
||||
}
|
||||
weapon = foundry.utils.duplicate(weapon)
|
||||
@@ -187,7 +187,7 @@ export class BoLRoll {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
let alchemy = actor.items.get(li.data("item-id"));
|
||||
if (!alchemy) {
|
||||
ui.notifications.warn("Unable to find Alchemy !");
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.AlchemyNotFound"));
|
||||
return;
|
||||
}
|
||||
alchemy = foundry.utils.duplicate(alchemy)
|
||||
@@ -198,7 +198,7 @@ export class BoLRoll {
|
||||
static alchemyCheckWithItem(actor, alchemy) {
|
||||
let alchemyData = alchemy.system
|
||||
if (alchemyData.properties.pccurrent < alchemyData.properties.pccost) {
|
||||
ui.notifications.warn("Pas assez de Points de Création investis dans la Préparation !")
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.NotEnoughCreationPrep"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -260,13 +260,13 @@ export class BoLRoll {
|
||||
/* -------------------------------------------- */
|
||||
static spellCheck(actor, event) {
|
||||
if (actor.system.resources.power.value <= 0) {
|
||||
ui.notifications.warn("Plus assez de points de Pouvoir !")
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.NoPower"))
|
||||
return
|
||||
}
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let spell = actor.items.get(li.data("item-id"))
|
||||
if (!spell) {
|
||||
ui.notifications.warn("Impossible de trouver ce sort !")
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.SpellNotFound"))
|
||||
return
|
||||
}
|
||||
spell = foundry.utils.duplicate(spell)
|
||||
@@ -583,7 +583,7 @@ export class BoLRoll {
|
||||
callback: (event, button, dialog) => {
|
||||
console.log("Submit Roll!!!!");
|
||||
if (rollData.mode == 'spell' && rollData.ppCurrent < rollData.ppCost) {
|
||||
ui.notifications.warn("Pas assez de Points de Pouvoir !")
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.NoPower"))
|
||||
return false
|
||||
}
|
||||
rollData.registerInit = (rollData.aptitude && rollData.aptitude.key == 'init') ?
|
||||
|
||||
@@ -246,10 +246,10 @@ export class BoLCalendar extends Application {
|
||||
}
|
||||
}
|
||||
else if (name) {
|
||||
ui.notifications.warn(name + " n'a pas d'heure de naissance, ou elle est incorrecte : " + heureNaissance);
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.NoBirthHour", { actor: name, hour: heureNaissance }));
|
||||
}
|
||||
else {
|
||||
ui.notifications.warn(heureNaissance + " ne correspond pas à une heure de naissance");
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.BadBirthHour", { hour: heureNaissance }));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ export class BoLUtility {
|
||||
event.preventDefault()
|
||||
let attr = event.currentTarget.attributes['data-attack-id']
|
||||
if (!attr) {
|
||||
ui.notifications.warn("Impossible de trouver l'attaque correspondante, erreur de suivi de combat.")
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.AttackNotFound"))
|
||||
return
|
||||
}
|
||||
let attackId = event.currentTarget.attributes['data-attack-id'].value
|
||||
@@ -583,7 +583,7 @@ export class BoLUtility {
|
||||
this.blindMessageToGM(chatOptions);
|
||||
|
||||
chatOptions.whisper = [game.user.id];
|
||||
chatOptions.content = "Message only to the GM";
|
||||
chatOptions.content = game.i18n.localize("BOL.chat.msgonlygm");
|
||||
}
|
||||
else {
|
||||
chatOptions.whisper = this.getUsers(user => user.isGM);
|
||||
|
||||
@@ -82,19 +82,19 @@ export class Macros {
|
||||
static _findItem(actor, type, nameOrIndex) {
|
||||
const items = actor.items.filter(i => i.type === type)
|
||||
if (items.length === 0) {
|
||||
ui.notifications.warn(`${actor.name} : aucun(e) ${type} trouvé(e).`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.MacroNoItemFound", { actor: actor.name, type }))
|
||||
return undefined
|
||||
}
|
||||
if (nameOrIndex === undefined || nameOrIndex === null) {
|
||||
if (items.length === 1) return foundry.utils.duplicate(items[0])
|
||||
const names = items.map((it, i) => `[${i}] ${it.name}`).join(', ')
|
||||
ui.notifications.warn(`Précisez le nom ou l'index : ${names}`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.MacroSpecifyNameOrIndex", { names }))
|
||||
return undefined
|
||||
}
|
||||
if (typeof nameOrIndex === "number") {
|
||||
const item = items[nameOrIndex]
|
||||
if (!item) {
|
||||
ui.notifications.warn(`${actor.name} : index ${nameOrIndex} invalide pour ${type}.`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.MacroBadIndex", { actor: actor.name, index: nameOrIndex, type }))
|
||||
return undefined
|
||||
}
|
||||
return foundry.utils.duplicate(item)
|
||||
@@ -102,7 +102,7 @@ export class Macros {
|
||||
const lower = String(nameOrIndex).toLowerCase()
|
||||
const found = items.find(i => i.name.toLowerCase().includes(lower))
|
||||
if (!found) {
|
||||
ui.notifications.warn(`${actor.name} : ${type} "${nameOrIndex}" introuvable.`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.MacroItemNotFound", { actor: actor.name, type, name: nameOrIndex }))
|
||||
return undefined
|
||||
}
|
||||
return foundry.utils.duplicate(found)
|
||||
@@ -118,7 +118,7 @@ export class Macros {
|
||||
actor = actor ?? this.getSpeakersActor()
|
||||
if (!actor) return
|
||||
if (!actor.system.attributes[key]) {
|
||||
ui.notifications.warn(`Attribut inconnu : "${key}". Valeurs : vigor, agility, mind, appeal`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.MacroUnknownAttribute", { key }))
|
||||
return
|
||||
}
|
||||
return BoLRoll.attributeCheck(actor, key)
|
||||
@@ -134,7 +134,7 @@ export class Macros {
|
||||
actor = actor ?? this.getSpeakersActor()
|
||||
if (!actor) return
|
||||
if (!actor.system.aptitudes[key]) {
|
||||
ui.notifications.warn(`Aptitude inconnue : "${key}". Valeurs : init, melee, ranged, def`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.MacroUnknownAptitude", { key }))
|
||||
return
|
||||
}
|
||||
return BoLRoll.aptitudeCheck(actor, key)
|
||||
@@ -164,7 +164,7 @@ export class Macros {
|
||||
actor = actor ?? this.getSpeakersActor()
|
||||
if (!actor) return
|
||||
if ((actor.system.resources.power?.value ?? 1) <= 0) {
|
||||
ui.notifications.warn("Plus assez de points de Pouvoir !")
|
||||
ui.notifications.warn(game.i18n.localize("BOL.notification.MacroNoPower"))
|
||||
return
|
||||
}
|
||||
const spell = this._findItem(actor, "spell", nameOrIndex)
|
||||
@@ -214,7 +214,7 @@ export class Macros {
|
||||
case "alchemy": return this.rollAlchemy(key, actor)
|
||||
case "horoscope": return this.rollHoroscope(key ?? "minor", actor)
|
||||
default:
|
||||
ui.notifications.warn(`Type de jet inconnu : "${type}". Types valides : attribute, aptitude, weapon, spell, alchemy, horoscope`)
|
||||
ui.notifications.warn(game.i18n.format("BOL.notification.MacroUnknownRollType", { type }))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user