Fix: Correction des clés i18n et affichage de l'onglet Effets
- Correction du namespace i18n: MOURNBLADECYD2.EFFECT → EFFECT
- Suppression de la condition {{#if item.effects.length}} dans tous les templates d'items
- Ajout de la clé EFFECT.noItemEffects pour les items sans effets
- Remplacement des textes en dur par des clés i18n dans les partials
- Mise à jour de toutes les références dans le code JavaScript
Cela corrige:
1. Les clés i18n manquantes (namespace incohérent)
2. L'onglet Effets des items qui était vide quand l'item n'avait pas d'effets
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -113,6 +113,7 @@
|
||||
"modeDowngrade": "Dégrader",
|
||||
"activeEffects": "Effets Actifs",
|
||||
"noActiveEffects": "Aucun effet actif",
|
||||
"noItemEffects": "Aucun effet sur cet item",
|
||||
"effectSummary": "Résumé des modifications",
|
||||
"toggleEffect": "Activer/Désactiver"
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
|
||||
try {
|
||||
// Créer les données par défaut pour un nouvel effet
|
||||
const defaultEffectData = {
|
||||
name: game.i18n.localize("MOURNBLADECYD2.EFFECT.new") || "Nouvel Effet",
|
||||
name: game.i18n.localize("EFFECT.new") || "Nouvel Effet",
|
||||
icon: "systems/fvtt-mournblade-cyd-2-0/assets/icons/capacite.webp",
|
||||
description: "",
|
||||
changes: [],
|
||||
@@ -354,7 +354,7 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to create effect:", error);
|
||||
ui.notifications.error(
|
||||
game.i18n.localize("MOURNBLADECYD2.EFFECT.createError") ||
|
||||
game.i18n.localize("EFFECT.createError") ||
|
||||
"Erreur lors de la création de l'effet"
|
||||
);
|
||||
}
|
||||
@@ -397,8 +397,8 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
|
||||
if (effect) {
|
||||
const effectName = effect.name;
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
title: game.i18n.localize("MOURNBLADECYD2.EFFECT.deleteConfirm") || "Supprimer l'effet",
|
||||
content: game.i18n.localize("MOURNBLADECYD2.EFFECT.deleteConfirmText", {name: effectName}) ||
|
||||
title: game.i18n.localize("EFFECT.deleteConfirm") || "Supprimer l'effet",
|
||||
content: game.i18n.localize("EFFECT.deleteConfirmText", {name: effectName}) ||
|
||||
`Êtes-vous sûr de vouloir supprimer l'effet "${effectName}" ?`
|
||||
});
|
||||
|
||||
@@ -408,7 +408,7 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to delete effect:", error);
|
||||
ui.notifications.error(
|
||||
game.i18n.localize("MOURNBLADECYD2.EFFECT.deleteError") ||
|
||||
game.i18n.localize("EFFECT.deleteError") ||
|
||||
"Erreur lors de la suppression de l'effet"
|
||||
);
|
||||
}
|
||||
@@ -436,7 +436,7 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to toggle effect:", error);
|
||||
ui.notifications.error(
|
||||
game.i18n.localize("MOURNBLADECYD2.EFFECT.toggleError") ||
|
||||
game.i18n.localize("EFFECT.toggleError") ||
|
||||
"Erreur lors du basculement de l'effet"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
||||
try {
|
||||
// Créer les données par défaut pour un nouvel effet
|
||||
const defaultEffectData = {
|
||||
name: game.i18n.localize("MOURNBLADECYD2.EFFECT.new") || "Nouvel Effet",
|
||||
name: game.i18n.localize("EFFECT.new") || "Nouvel Effet",
|
||||
icon: "systems/fvtt-mournblade-cyd-2-0/assets/icons/capacite.webp",
|
||||
description: "",
|
||||
changes: [],
|
||||
@@ -215,7 +215,7 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to create effect:", error);
|
||||
ui.notifications.error(
|
||||
game.i18n.localize("MOURNBLADECYD2.EFFECT.createError") ||
|
||||
game.i18n.localize("EFFECT.createError") ||
|
||||
"Erreur lors de la création de l'effet"
|
||||
);
|
||||
}
|
||||
@@ -258,8 +258,8 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
||||
if (effect) {
|
||||
const effectName = effect.name;
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
title: game.i18n.localize("MOURNBLADECYD2.EFFECT.deleteConfirm") || "Supprimer l'effet",
|
||||
content: game.i18n.localize("MOURNBLADECYD2.EFFECT.deleteConfirmText", {name: effectName}) ||
|
||||
title: game.i18n.localize("EFFECT.deleteConfirm") || "Supprimer l'effet",
|
||||
content: game.i18n.localize("EFFECT.deleteConfirmText", {name: effectName}) ||
|
||||
`Êtes-vous sûr de vouloir supprimer l'effet "${effectName}" ?`
|
||||
});
|
||||
|
||||
@@ -269,7 +269,7 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to delete effect:", error);
|
||||
ui.notifications.error(
|
||||
game.i18n.localize("MOURNBLADECYD2.EFFECT.deleteError") ||
|
||||
game.i18n.localize("EFFECT.deleteError") ||
|
||||
"Erreur lors de la suppression de l'effet"
|
||||
);
|
||||
}
|
||||
@@ -297,7 +297,7 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to toggle effect:", error);
|
||||
ui.notifications.error(
|
||||
game.i18n.localize("MOURNBLADECYD2.EFFECT.toggleError") ||
|
||||
game.i18n.localize("EFFECT.toggleError") ||
|
||||
"Erreur lors du basculement de l'effet"
|
||||
);
|
||||
}
|
||||
@@ -326,7 +326,7 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
||||
// Cette méthode est placeholders - l'application devrait être gérée par drag-drop
|
||||
// ou par une action spécifique qui demande à l'utilisateur de sélectionner un acteur
|
||||
ui.notifications.warn(
|
||||
game.i18n.localize("MOURNBLADECYD2.EFFECT.selectActor") ||
|
||||
game.i18n.localize("EFFECT.selectActor") ||
|
||||
"Veuillez d'abord sélectionner un acteur pour appliquer cet effet."
|
||||
);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ export class MournbladeCYD2Effects {
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to apply effect:", error);
|
||||
ui.notifications?.error(
|
||||
game.i18n?.localize("MOURNBLADECYD2.EFFECT.applyError") ||
|
||||
game.i18n?.localize("EFFECT.applyError") ||
|
||||
`Erreur: Impossible d'appliquer l'effet (${error.message})`
|
||||
);
|
||||
return null;
|
||||
@@ -259,7 +259,7 @@ export class MournbladeCYD2Effects {
|
||||
} catch (error) {
|
||||
console.error("MournbladeCYD2 | Failed to apply item effects:", error);
|
||||
ui.notifications?.error(
|
||||
game.i18n?.localize("MOURNBLADECYD2.EFFECT.applyItemError") ||
|
||||
game.i18n?.localize("EFFECT.applyItemError") ||
|
||||
`Erreur: Impossible d'appliquer les effets de l'item`
|
||||
);
|
||||
return [];
|
||||
|
||||
@@ -90,11 +90,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@@ -19,11 +19,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -78,11 +78,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@@ -44,10 +44,8 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@@ -21,11 +21,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@@ -31,11 +31,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -27,11 +27,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -97,11 +97,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -27,11 +27,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@@ -23,11 +23,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@@ -73,10 +73,8 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -61,11 +61,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -55,11 +55,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@@ -32,11 +32,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -19,10 +19,8 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
</div>
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{#if item.effects.length}}
|
||||
<div class="tab effects" data-group="primary" data-tab="effects">
|
||||
{{> systems/fvtt-mournblade-cyd-2-0/templates/partial-item-effects.hbs}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
{{!-- En-tête --}}
|
||||
<li class="item flexrow list-item items-title-bg">
|
||||
<span class="item-name-label-header">
|
||||
<h3><label class="items-title-text">Effets Actifs</label></h3>
|
||||
<h3><label class="items-title-text">{{localize "EFFECT.activeEffects"}}</label></h3>
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control" data-action="createEffect" title="Ajouter un effet">
|
||||
<a class="item-control" data-action="createEffect" title="{{localize "EFFECT.new"}}">
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
@@ -19,7 +19,7 @@
|
||||
{{!-- Affiche un message si aucun effet --}}
|
||||
{{#if (not actor.effects.length)}}
|
||||
<li class="item flexrow">
|
||||
<span class="item-name-label competence-name" style="color: #888; font-style: italic;">Aucun effet actif</span>
|
||||
<span class="item-name-label competence-name" style="color: #888; font-style: italic;">{{localize "EFFECT.noActiveEffects"}}</span>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
{{!-- Affichage détaillé des effets actifs --}}
|
||||
{{#if actor.effects.length}}
|
||||
<div class="sheet-box color-bg-archetype effect-summary">
|
||||
<h4 class="section-title">Résumé des modifications</h4>
|
||||
<h4 class="section-title">{{localize "EFFECT.effectSummary"}}</h4>
|
||||
<div class="effect-modifications">
|
||||
{{#each actor.effects as |effect|}}
|
||||
{{#if (not effect.disabled)}}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
{{!-- En-tête --}}
|
||||
<li class="item flexrow list-item items-title-bg">
|
||||
<span class="item-name-label-header">
|
||||
<h3><label class="items-title-text">Effets Actifs</label></h3>
|
||||
<h3><label class="items-title-text">{{localize "EFFECT.activeEffects"}}</label></h3>
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control" data-action="createEffect" title="Ajouter un effet">
|
||||
<a class="item-control" data-action="createEffect" title="{{localize "EFFECT.new"}}">
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
@@ -19,7 +19,7 @@
|
||||
{{!-- Affiche un message si aucun effet --}}
|
||||
{{#if (not item.effects.length)}}
|
||||
<li class="item flexrow">
|
||||
<span class="item-name-label competence-name" style="color: #888; font-style: italic;">Aucun effet sur cet item</span>
|
||||
<span class="item-name-label competence-name" style="color: #888; font-style: italic;">{{localize "EFFECT.noItemEffects"}}</span>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description" aria-label="{{localize 'MNBL.description'}}">{{localize "MNBL.description"}}</a>
|
||||
<a class="item" data-tab="details" aria-label="{{localize 'MNBL.details'}}">{{localize "MNBL.details"}}</a>
|
||||
<a class="item" data-tab="effects" aria-label="{{localize 'MOURNBLADECYD2.EFFECT.activeEffects'}}">{{localize "MOURNBLADECYD2.EFFECT.activeEffects"}}</a>
|
||||
<a class="item" data-tab="effects" aria-label="{{localize 'EFFECT.activeEffects'}}">{{localize "EFFECT.activeEffects"}}</a>
|
||||
</nav>
|
||||
<hr />
|
||||
|
||||
Reference in New Issue
Block a user