Skip to content

Dealing with non-existing keys #23

@thany

Description

@thany

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions