foundryvtt / foundryvtt

Public issue tracking and documentation for Foundry Virtual Tabletop - software connecting RPG gamers in a shared multiplayer environment with an intuitive interface and powerful API.
https://foundryvtt.com/
198 stars 10 forks source link

Select options are not localized using the `labelAttr` in the `{{formField}}` helper #10908

Closed Fyorl closed 2 weeks ago

Fyorl commented 2 weeks ago

Originally reported by zhell9201 https://discord.com/channels/170995199584108546/1184176415139184731/1238865040229142598

Short Description of bug: Select options are not localized using labelAttr in the {{formField}} helper. Simple steps to reproduce the bug:

const field = new foundry.data.fields.NumberField({
  choices: {
    1: {steve: "OPTION 1"},
    2: {steve: "OPTION 2"}
  }
});
console.log(HandlebarsHelpers.formField(field, {hash: {labelAttr: "steve", localize: true}}).string)