Fixed localization

This commit is contained in:
WBHarry 2025-07-28 19:26:23 +02:00
parent 2fbbf98f88
commit e22d086990
3 changed files with 756 additions and 264 deletions

View file

@ -118,13 +118,14 @@ export default class DHWeapon extends AttachableItem {
for (let weaponFeature of added) {
const featureData = CONFIG.DH.ITEM.weaponFeatures[weaponFeature.value];
if (featureData.effects?.length > 0) {
const embeddedItems = await this.parent.createEmbeddedDocuments('ActiveEffect', [
{
name: game.i18n.localize(featureData.label),
description: game.i18n.localize(featureData.description),
changes: featureData.effects.flatMap(x => x.changes)
}
]);
const embeddedItems = await this.parent.createEmbeddedDocuments(
'ActiveEffect',
featureData.effects.map(effect => ({
...effect,
name: game.i18n.localize(effect.name),
description: game.i18n.localize(effect.description)
}))
);
weaponFeature.effectIds = embeddedItems.map(x => x.id);
}