Skip to content

Commit

Permalink
Merge pull request #1204 from tigerabrodi/allow-trans-tOptions-interp…
Browse files Browse the repository at this point in the history
…olation

feat(trans): allow interpolation in tOptions if provided
  • Loading branch information
jamuhl authored Dec 2, 2020
2 parents 0d0f4d8 + d8043dc commit a5a0167
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Trans.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export function Trans({
count,
parent,
i18nKey,
tOptions,
tOptions = {},
values,
defaults,
components,
Expand Down Expand Up @@ -290,7 +290,9 @@ export function Trans({
i18nKey;
const { hashTransKey } = reactI18nextOptions;
const key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
const interpolationOverride = values ? {} : { interpolation: { prefix: '#$?', suffix: '?$#' } };
const interpolationOverride = values
? tOptions.interpolation
: { interpolation: { ...tOptions.interpolation, prefix: '#$?', suffix: '?$#' } };
const combinedTOpts = {
...tOptions,
count,
Expand Down

0 comments on commit a5a0167

Please sign in to comment.