cibernox / svelte-intl-precompile

I18n library for Svelte.js that analyzes your keys at build time for max performance and minimal footprint
https://svelte-intl-precompile.com
ISC License
274 stars 13 forks source link

Not showing warning for empty string translation #56

Closed EskelCz closed 1 year ago

EskelCz commented 1 year ago

Thanks for this awesome library. :) Just a super simple question/request. Does it make sense to throw a warning for $t('') that '' was not found in the dictionary? Because I don't think think translating an empty string to something else is very useful. :)

I like both my code and console as clean as possible and this forces me to add a lot of ugly checks for empty strings. Thanks for your consideration.

cibernox commented 1 year ago

I think it makes sense to show a warning for any attempt to translate a key that is not in the dictionary of known keys. At most I'd concede that for this case it could be a different warning. I'd expect that if someone tries to translate an empty string that's probably an unintender bug/typo.