Closed Maxhodges closed 7 years ago
Hi Max,
let's assume you have the following translation registered:
{
en: {
foo: {
bar: 'baz'
}
}
}
As the dot (.
) is the default separator, you can get the value of the translation by simply calling
translate('foo.bar', { locale: 'en' }) //=> 'baz'
If for whatever reason you cannot use the dot character (perhaps because you already use it as part of the individual (sub)keys, for example fo.o
), you can switch to a different separator character like this:
translate('foo/bar', { locale: 'en', separator: '/' }) //=> 'baz'
I hope this answers you question. If not, please let me know!
I'm unclear about what the docs are saying about 'splitting'. Can someone explain better? This doesn't seem grammatical to me