Navigation Menu

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

Setting options on individual translations override, rather than merge global configs #832

Closed
stiliyan opened this issue Oct 31, 2016 · 3 comments

Comments

@stiliyan
Copy link

Passing configurations to individual translations override their global counterparts, when they should be merged instead.

In the following example the desired output is some <span>foo</span>, so we set the interpolation: { escapeValue: false } option on the translation. Instead i18next outputs some __foo__, because the global interpolation.prefix and interpolation.suffix configs are overridden, rather than merged with the custom interpolation config.

global config:

{
  interpolation: {
    prefix: '__',
    suffix: '__'
  }
}

translations:

{ 
  "en": {
    "translation": {
      "tag": "some __foo__"
    }
}

call with custom options, expecting some <span>foo</span> to be output:

i18next.t('tag', { interpolation: { escapeValue: false }, foo: '<span>foo</span>' })

output:

some __foo__
@jamuhl
Copy link
Member

jamuhl commented Nov 1, 2016

agree....will fix this for next version.

@jamuhl jamuhl added the issue label Nov 1, 2016
@jamuhl
Copy link
Member

jamuhl commented Nov 7, 2016

should be fixed in upcoming 3.5.0

@jamuhl
Copy link
Member

jamuhl commented Nov 7, 2016

feel free to reopen if still an issue.

@jamuhl jamuhl closed this as completed Nov 7, 2016
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