Description
🚀 Feature Proposal
Enable disallowing plural-suffixed keys as the first argument to t
, perhaps through CustomTypeOptions
.
Motivation
- The TS autocomplete list for
t
can easily become very large and hard to look through. - I'd never do
t('key_one')
ort('key_other')
, I'd always dot('key', { count })
.
Considering these, it would be great if the plural-suffixed variations of keys were not considered valid. This would drastically decrease the number of options in my IDE autocomplete and help discourage bad practice. Currently, a key in English with _one
and _other
suffixes creates 6 possible values:
- key
- key_one
- key_other
- translation:key
- translation:key_one
- translation:key_other
This could be only 2 values if we removed the plural-suffixed options.
Example
I type t('
, then ctrl+space
to open autocomplete, and I only see the basic keys without plural suffixes.
Additionally, if I try to include the plural suffix in the key instead of using the count
option for some reason, I get a type error, which is desired.