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/
192 stars 10 forks source link

Ensure that select options labels are localized as strings. #10782

Closed Fyorl closed 2 weeks ago

Fyorl commented 2 weeks ago

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

Short Description of bug: Registering a setting with a NumberField as the type prevents the settings menu from rendering if using choices instead of step.

Simple steps to reproduce the bug: Using the example in the comment above game.settings.register works fine. If using choices: [10, 20, 30, 40, ...] instead of step in the DataField, the settings app cannot render.

Screenshots and/or console errors:

image

Fyorl commented 2 weeks ago

When triaging this I identified the root cause as prepareSelectOptionGroups calling game.i18n.localize(label) where label was a number from the NumberField's choices array.