We should be able to get the data from GlotPress' locales.php. It will need to be escaped, see the caution in the autocomplete readme. Maybe using Gutenberg's escape-html package. IIRC there's also wp.utils.sanitize().
An alternative to using templates could be to just put the alternative name in the raw data before passing it to JS. It'd only need to be added if the two aren't identical.
A search for
日本語
will return the correct result, but a search forJapanese
won't.https://github.com/alphagov/accessible-autocomplete/#templates-default-undefined
https://alphagov.github.io/accessible-autocomplete/examples/
We should be able to get the data from GlotPress'
locales.php
. It will need to be escaped, see the caution in the autocomplete readme. Maybe using Gutenberg'sescape-html
package. IIRC there's alsowp.utils.sanitize()
.An alternative to using
templates
could be to just put the alternative name in the raw data before passing it to JS. It'd only need to be added if the two aren't identical.Related: #93