From b58e540c9e851a81e114ac01413ab153e0e5a99a Mon Sep 17 00:00:00 2001 From: Karl Taylor <16408267+k4r1@users.noreply.github.com> Date: Tue, 24 Sep 2019 17:02:12 +0800 Subject: [PATCH] Use count from `values` object passed to Trans If a `count` is specified in the `values` object passed to Trans, we should use it, even if the `count` property is not provided. https://github.com/i18next/i18next/issues/1330 By changing the order of the construction of `combinedTOpts`, this should ensure that the behaviour is as expected. --- src/Trans.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Trans.js b/src/Trans.js index 4aa699a0..aad23152 100644 --- a/src/Trans.js +++ b/src/Trans.js @@ -234,10 +234,10 @@ export function Trans({ const interpolationOverride = values ? {} : { interpolation: { prefix: '#$?', suffix: '?$#' } }; const combinedTOpts = { ...tOptions, + count, ...values, ...interpolationOverride, defaultValue, - count, ns: namespaces, }; const translation = key ? t(key, combinedTOpts) : defaultValue;