Why does my namespace contain an array with a lot of null items?
When locize serves nested json, it tries to unflatten the keys which by default thinks that key parts being numbers, should be items of an array.
Suppose, you have the following keys:
This would be published as a nested json like this:
But sometimes you do no like to have an array.
For example, having these keys:
Would be published as a nested json like this:
To prevent this add a non-numeric key, like this:
This would be published as a nested json like this:
We do recommend to not mix nested and flat keys format.
i.e. keys like that:
{
"my.3.paragraph": {
"someNested": "key"
}
}
will be represented like this in flat format:
{
"my.3.paragraph.someNested": "key"
}
and like this in nested format:
{
"my": [
null,
null,
null,
{
"paragraph": {
"someNested": "key"
}
}
]
}
Last updated