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

__h has strange behavior when he doesn't have the key #485

Open
OfirKariv opened this issue Nov 23, 2021 · 1 comment
Open

__h has strange behavior when he doesn't have the key #485

OfirKariv opened this issue Nov 23, 2021 · 1 comment

Comments

@OfirKariv
Copy link

Hey guys,

While using __h to get all the translations on a certain key, when I am inserting an invalid key the result is a follow:

key: "test_key"

response:
[
"en-US" : "test_key",
"es-ES" : "test_key",
"fr-FR" : "test_key"
]

I wish there was a way to know your ,module didn't find any value for this key.

@mashpie
Copy link
Owner

mashpie commented Mar 5, 2022

you may configure a function that acts as middleware on every call for a missing key:

  // used to alter the behaviour of missing keys
  missingKeyFn: function (locale, value) {
    return value
  },

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

2 participants