Hello guys :)
so we have nested object
en: {
translations: {
"hello": "hello_EN",
"nested": { "test": "testEN" },
"one": {"two": {"three": "superNested_EN"}}
}
},
// this works fine
{this.props.t('hello')}
// and this is not works
{this.props.t('nested.test')}
{this.props.t('one.two.three')}
untill in our i18n init object we will not add keySeparator: "."
by default it's keySeparator: false
I spent some time to find out how to access nested objects and I haven't found nothing about it in documentation. Or I missed something ? :(
the default is . https://github.com/i18next/i18next/blob/master/src/defaults.js#L17
the sample might use keySeparator: false but the default if omitting that on init is .
Thanks for ur answer. Seems I missed something. Because when I created settings for my react app I made keySeparator: false and after I spent half day to undestand why nesting isn't works :(
Most helpful comment
Thanks for ur answer. Seems I missed something. Because when I created settings for my react app I made keySeparator: false and after I spent half day to undestand why nesting isn't works :(