Replies: 1 comment
-
@Alvi24 you don't need to use multiple namespaces if you don't want to β simply create a single namespace, set import i18next from 'i18next'
declare module 'i18next' {
interface CustomTypeOptions {
enableSelector: 'optimize'
defaultNS: 'translation'
resources: {
translation: {
abc: {
ghi: 'abc::ghi'
jkl: 'abc::jkl'
}
def: {
mno: 'def::mno'
pqr: 'def::pqr'
}
}
}
}
}
const ex_01 = i18next.t($ => $.abc.ghi)
// ^? const ex_01: "abc::ghi"
const ex_02 = i18next.t($ => $.def.mno)
// ^? const ex_02: "def::mno" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i want to make t function typesafe but i don't want to use namespaces (and also make i18n.t() typesafe)
Beta Was this translation helpful? Give feedback.
All reactions