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

Allow translate function to skip interpolation and return raw values instead #1050

Merged
merged 2 commits into from
May 8, 2018

Conversation

manixate
Copy link
Contributor

@manixate manixate commented May 8, 2018

This PR allows skipping interpolation but still allows post processing of the returned values. Let me know if you want post processing to be skipped as well. I allowed it because post processing already has options.applyPostProcessor to enable or disable it.

Fixes: #1007

@coveralls
Copy link

coveralls commented May 8, 2018

Coverage Status

Coverage increased (+0.1%) to 85.45% when pulling ef6fba7 on manixate:feature/skipInterpolation into b36c0a4 on i18next:master.

@jamuhl
Copy link
Member

jamuhl commented May 8, 2018

@manixate thanks for providing this PR. Agree with you excluding postProcessing can be done by using the other option. Will merge and publish this now.

@jamuhl jamuhl merged commit 6000591 into i18next:master May 8, 2018
@jamuhl
Copy link
Member

jamuhl commented May 8, 2018

Just doing some adjustments:

a) it's not on defaults as this is only in options passed to t function not the global i18next options (configuration) -> just an opt-out on t call
b) skipInterpolation is not applied if i18nFormat is set -> different parser (eg. ICU)

@jamuhl
Copy link
Member

jamuhl commented May 8, 2018

published in [email protected]

thanks again for providing this complete PR

@manixate
Copy link
Contributor Author

manixate commented May 8, 2018

I agree on:

skipInterpolation is not applied if i18nFormat is set -> different parser (eg. ICU)

For my use-case it is perfectly fine but the reason I skipped the whole i18nFormat was because the linked issue mentioned performance reasons and I thought skipping would be beneficial.

@jamuhl
Copy link
Member

jamuhl commented May 8, 2018

the issue was created before having those additional i18nFormats...so not affected there when using those format plugins...

@manixate manixate deleted the feature/skipInterpolation branch May 9, 2018 02:09
sm2017 added a commit to sm2017/i18next-gitbook that referenced this pull request Mar 25, 2019
reZach pushed a commit to reZach/i18next-gitbook that referenced this pull request Mar 1, 2020
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

3 participants