Why are some keys in a JSON object missing from the downloaded files?

You might encounter a situation, when not all keys that are a part of the same structure get downloaded from your Localazy project. Most likely, the issue here is that you have the key both as a single text and also as a structure.

This often happens when you first create a key and later decide to actually change it to an object with multiple subkeys.

So at first, you create a key, e.g.: user.welcome with text “This is a welcome text.”

But then, you decide you want to use a structure such as:

  • user.welcome.text => “This is a welcome text.”
  • user.welcome.title => “Welcome title”

Supposed it is a nested JSON, then you can’t have both:

{
"user.welcome": "This is a welcome text.",
}

and at the same time use:

{
"user.welcome": {
"text": "This is a welcome text",
"title": "Welcome title"
}
}

Because the same key can not be an object and a text at the same time.

In the future, you can simply prevent this, by using deprecating during upload so old keys are automatically marked as deprecated when they are no longer part of the uploaded file. In your CLI configuration, set deprecate to value project, and all keys missing in the upload batch across whole project will be deprecated.

Was this article helpful?

Please help us with improving our documentation.
We appreciate all your feedback.

Category

Last updated

18/09/2023