fix(i18n): localisation des notifications et messages d'erreur du système

This commit is contained in:
2026-08-04 09:14:29 +02:00
parent de1fa8ba72
commit 6719deb8fc
11 changed files with 102 additions and 25 deletions
+8 -8
View File
@@ -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 }))
}
}