Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with non-existing keys #23

Open
thany opened this issue Aug 5, 2024 · 0 comments
Open

Dealing with non-existing keys #23

thany opened this issue Aug 5, 2024 · 0 comments

Comments

@thany
Copy link

thany commented Aug 5, 2024

It would be helpful to be able to indicate what to do when a translation key couldn't be found. Currently it just returns an empty string, which is probably meant to to clog up a production website with warnings, and to keep junk (like keys) from appearing on the website.

But it would be helpful to know the difference between translation keys that are genuinely set to an empty string, and ones that are totally missing. Especially during development. Even on production it's helpful for translators to know which keys are missing.

Personally, I would say return the key when it doesn't exist. But perhaps returning undefined might work as well. Better yet, add an option (in the I18nProvider) to indicate what to do. Could be a callback function, or just a returnKeyNameWhenNotFound or something more elegant, or some other approach.

Currently not knowing why a translation is returning empty is kinda frustrating. More so because it appears to be hardcoded in such a way that there's no way to override this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant