Replies: 1 comment
-
Moving this to the Ideas Discussion. In general, it is hard to find an elegant way to add all the wordlists, because English makes up about But, each word list adds to the size and is rarely used. In v6, I've managed to get the size down to 54kb for the other 9 languages, but they are stripped out by default for the web Le sigh... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Feature
Currently, the
wordlists
const's type is{ [ locale: string ]: Wordlist }
, which does not restrict from using different locale strings, which would thenundefined
in runtime. Instead, I suggest to make thewordlists
the signle source of truth ie use const assertion, and draw the type from it. This way the consuming code will complain in compile-time if given locale does not exist.Extensibility would not be hindered as one can always do something like:
I've made a PR to reflect this.
Code Example
Beta Was this translation helpful? Give feedback.
All reactions