Hello :wave: At <@U01NL7HM0SV>’s request I'm worki...
# i18n
a
Hello šŸ‘‹ At @Peer’s request I'm working on a simple eslint plugin that performs various checks on the translatable keys being used throughout the codebase. However, there are instances in the code like the following:
Copy code
const { t } = useLocale();
<button>{t(someTest ? var1 : var2)}</button>
Instances like the above make it difficult for eslint to understand what the resolved value here will be, and therefore these instances will be ignored for now. If desired the eslint plugin could provide a warning to use literals inside the
t()
function, but that's not part of my initial efforts
Correction ā˜ļø I was able to discover a more reliable approach, which will be detailed in the upcoming PR
p
btw does your script also detect pluralism? because i think some keys are stuff_one or something
super excited about this
a
It doesn't detect that at the moment. That might be a difficult thing to detect automatically, but I can spend some time on that if you'd prefer