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

Add error handling for failed parsing. Allow custom error handler. #24

Merged
merged 4 commits into from
Jun 3, 2020

Conversation

jesseyay
Copy link
Contributor

@jesseyay jesseyay commented Jun 2, 2020

Added custom error handler when parsing fails. Addresses this issue #21

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • documentation is changed or added

src/index.js Outdated Show resolved Hide resolved
i18nextICU.js Outdated Show resolved Hide resolved
Added non-interpollated string as an argument and as the default return.
@jesseyay
Copy link
Contributor Author

jesseyay commented Jun 3, 2020

Hi @jamuhl,
I made a few changes to give some more flexibility with the error handling. I'm happy for you to merge it when you can.
How soon do you think this will make it into a new release?

@jesseyay jesseyay requested a review from jamuhl June 3, 2020 00:21
@jamuhl jamuhl merged commit 347884b into i18next:master Jun 3, 2020
Copy link
Member

@jamuhl jamuhl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@jamuhl jamuhl requested review from jamuhl and removed request for jamuhl June 3, 2020 06:31
@jamuhl
Copy link
Member

jamuhl commented Jun 3, 2020

published in i18next-icu@1.4.0

bindI18nStore: ''
bindI18nStore: '',

// Will be run when parser throws an error. Return a string to use in place of the translation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest a slight re-phrase: "Return a string to use in place of the translation" => "Can return any string, which can be used as a fallback, in case of broken translation.

@sidoruk-sv sidoruk-sv mentioned this pull request Jun 11, 2020
4 tasks
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

Successfully merging this pull request may close these issues.

None yet

4 participants