File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ type I18nextIntegration = {
39
39
40
40
const identity = ( ( key : string ) => key ) as TFunction ;
41
41
42
+ const defaultVariables = createStore ( { } , { serialize : 'ignore' } ) ;
43
+
42
44
export function createI18nextIntegration ( {
43
45
instance,
44
46
setup,
@@ -175,13 +177,10 @@ export function createI18nextIntegration({
175
177
variables ?: Record < string , Store < string > >
176
178
) : Store < string > {
177
179
return combine (
178
- {
179
- t : $t ,
180
- variables : variables
181
- ? combine ( variables )
182
- : createStore ( null , { serialize : 'ignore' } ) ,
183
- } ,
184
- ( { t, variables } ) => t ( key , variables ?? undefined ) ?? key
180
+ $t ,
181
+ variables ? combine ( variables ) : defaultVariables ,
182
+ // @ts -expect-error lng is special variable, it should not be passed to t
183
+ ( t , { lng, ...vars } ) => t ( key , vars ) ?? key
185
184
) ;
186
185
}
187
186
You can’t perform that action at this time.
0 commit comments