Localize the spells section

This commit is contained in:
Oliver-Akins 2024-01-10 19:17:26 -07:00
parent 4eb641d474
commit df1e768cc2
2 changed files with 44 additions and 7 deletions

View file

@ -170,6 +170,20 @@
"mag": "Mags", "mag": "Mags",
"cell": "Cells" "cell": "Cells"
} }
},
"spells": {
"empty": "You have no spells yet",
"title.cost": "(Cost: {cost})",
"name.label": "Name",
"cost": {
"label": "Cost",
"placeholder": "Bytes per spell cast..."
},
"description": {
"label": "Description",
"placeholder": "This spell does..."
},
"add.label": "Add Spell"
} }
}, },
"sync": { "sync": {
@ -199,7 +213,16 @@
}, },
"notification": { "notification": {
"error": { "error": {
"invalid-integer": "You must enter a valid whole number" "invalid-integer": "You must enter a valid whole number",
"item-not-found": "Failed to find an item to delete."
}
},
"dialogs": {
"spell": {
"delete": {
"title": "Confirm Spell Deletion",
"content": "Are you sure you would like to delete the spell: {name}<br /><br />This action cannot be reversed."
}
} }
} }
}, },

View file

@ -4,14 +4,16 @@
<summary data-collapse-id="{{spell.uuid}}"> <summary data-collapse-id="{{spell.uuid}}">
<span class="flex-grow" style="flex-grow: 1"> <span class="flex-grow" style="flex-grow: 1">
{{spell.name}} {{spell.name}}
(Cost: {{spell.system.cost}}) {{localize "dotdungeon.actor.pc.spells.title.cost" cost=spell.system.cost}}
</span> </span>
</summary> </summary>
<div class="spell"> <div class="spell">
<div class="spell__name"> <div class="spell__name">
<label for="{{spell.uuid}}-name">Name</label> <label for="{{spell.uuid}}-name">
{{localize "dotdungeon.actor.pc.spells.name.label"}}
</label>
<input <input
type="text" type="text"
id="{{spell.uuid}}-name" id="{{spell.uuid}}-name"
@ -21,19 +23,25 @@
> >
</div> </div>
<div class="spell__cost"> <div class="spell__cost">
<label for="{{spell.uuid}}-cost">Cost</label> <label for="{{spell.uuid}}-cost">
{{localize "dotdungeon.actor.pc.spells.cost.label"}}
</label>
<input <input
type="text" type="text"
id="{{spell.uuid}}-cost" id="{{spell.uuid}}-cost"
value="{{spell.system.cost}}" value="{{spell.system.cost}}"
placeholder="{{localize "dotdungeon.actor.pc.spells.cost.placeholder"}}"
data-embedded-update="system.cost" data-embedded-update="system.cost"
data-embedded-id="{{spell.uuid}}" data-embedded-id="{{spell.uuid}}"
> >
</div> </div>
<div class="spell__description"> <div class="spell__description">
<label for="{{spell.uuid}}-description">Description</label> <label for="{{spell.uuid}}-description">
{{localize "dotdungeon.actor.pc.spells.description.label"}}
</label>
<textarea <textarea
id="{{spell.uuid}}-description" id="{{spell.uuid}}-description"
placeholder="{{localize "dotdungeon.actor.pc.spells.description.placeholder"}}"
data-embedded-update="system.description" data-embedded-update="system.description"
data-embedded-id="{{spell.uuid}}" data-embedded-id="{{spell.uuid}}"
>{{spell.system.description}}</textarea> >{{spell.system.description}}</textarea>
@ -48,6 +56,8 @@
</button> </button>
<button <button
class="danger reduced-padding equal-padding" class="danger reduced-padding equal-padding"
data-embedded-delete
data-embedded-id="{{spell.uuid}}"
> >
<div class="icon icon--20"> <div class="icon icon--20">
{{{ ../icons.garbage-bin }}} {{{ ../icons.garbage-bin }}}
@ -55,10 +65,14 @@
</button> </button>
</div> </div>
</div> </div>
<div class="debug-data">
{{spell.uuid}}
{{dd-stringify spell}}
</div>
</details> </details>
{{else}} {{else}}
<p> <p>
You have no spells yet! {{localize "dotdungeon.actor.pc.spells.empty"}}
</p> </p>
{{/each}} {{/each}}
@ -71,7 +85,7 @@
{{{ icons.create }}} {{{ icons.create }}}
</div> </div>
<span> <span>
Add Spell {{localize "dotdungeon.actor.pc.spells.add.label"}}
</span> </span>
</button> </button>
</div> </div>