mroderick / plete

Vanilla autocomplete component
https://plete.dev
BSD 3-Clause "New" or "Revised" License
35 stars 4 forks source link

Localization support for constants #79

Open Lewiscowles1986 opened 3 years ago

Lewiscowles1986 commented 3 years ago

Is your feature request related to a problem? Please describe.

While working on #77 I introduced a constant to the library, which would embed English within the component. For non-English speakers this might represent a problem, or inconsistency with the announced highlighted option.

Describe the solution you'd like

Ideally for the problem introduced, a new piece of state could be introduced to allow user-supplied values for these constants, which have default values.

Describe alternatives you've considered

Library locale aware

The library could become locale aware, and locale could be sent in as state.

This might help other efforts, such as requesting localized results from a remote server. As user-js is needed to bootstrap plete, this was already possible, and might be something for Plete to avoid.

Differentiation of highlighted items could be removed

78 could remove the differentiation and just announce the item without a custom aria-label.

Motivation and involvement

Proof of concept

There is not, but it's an optional configuration value passed around with state context.

Additional context

N/A