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

Check whether entry exists #103

Open
iStooge opened this issue Jan 30, 2017 · 1 comment
Open

Check whether entry exists #103

iStooge opened this issue Jan 30, 2017 · 1 comment

Comments

@iStooge
Copy link

iStooge commented Jan 30, 2017

Is there a way to check whether an entry is existing?

I am using i18n for a Chatbots natural language classification. When a certain case can not be handled with the saved i18n statements I want either to check wether it exists or return a default statement.

Just like this:
i18n.__('i18n_statement_missing', {default: 'default.statement'})

or like this:

if !i18n.__('i18n_statement_missing').exists ...

@gjuchault
Copy link
Collaborator

I guess you can use something like if (typeof i18n.__('i18n_statement_missing') !== 'string')

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