Localazy download only downloads one string

I have defined “Developer english” and one more language in the portal and when i run localazy download it creates a xx.json and a tr.json (turkish) file, but both files only contain one entry. There is 113 source keys in the portal and they are all active.

It seems extremely counterintuitive that all the keys are not downloaded - why is this even possible?

How can i fix this?

This is the localazy.json file;

{
“writeKey”: “REMOVED”,
“readKey”: “REMOVED”,

“upload”: {
“type” : “json”,
“files”: “translations/xxa.json”
},

“download”: {
“files”: “translations/${lang}.json”,
“includeSourceLang”: true
},

“conversion”: {},
“transformations”: []
}

EDIT:

I do not know if this is related but i get this warning in the cli - which i do not understand what means - could it be related?

Performing file format conversions…

=========== WARNING, FILES OVERWRITTEN ============
You are attempting to store several downloaded files to the same target file.
This is usually undesired behavior caused by misconfigured download section.

Problem detected for translations/tr.json being target for:

  • lang=tr, file=file.json, type=json
  • lang=tr, file=en.json, type=json
  • lang=tr, file=xxa.json, type=json

Problem detected for translations/xxa.json being target for:

  • lang=xxa, file=file.json, type=json
  • lang=xxa, file=en.json, type=json
  • lang=xxa, file=xxa.json, type=json

Hello,

The issue here is that you have more files on Localazy, but in your `localazy.json, ’ you write them all to the same location and overwrite them. That’s why you get the error.

You need to update the download part of your configuration to embrace the file name. It would probably be better to introduce a better logic to naming files.

{
  "download": {
    "files": "translations/${lang}/${file}",
    "includeSourceLang": true
  }
}

Ok - but then i end up with three files per language - what is the purpose of that?

Also - i want a simpler structure with a translations folder with the languages side-by-side in files like this; en.json, de.json, fr.json, etc.

Why can’t i simply upload a json file with key-value pairs, get this translated and then downloaded as files named after the language?

You can upload JSON and download it for all the languages; it’s the very basic function of Localazy.

However, you already have more files on Localazy, so I would recommend downloading them, joining them together, and reuploading or, if you don’t need them all, just removing those that are unnecessary from Localazy.

What does it mean that i “have more files on Localazy”? How have i defined more files? I obviously do not understand the file concept of this service.

You can go to the File Management screen in Localazy to see all the files.

Basically, your project consists of files, where a file is a set of keys in all the languages.

Do you want a demo with my colleague to show you around and explain the concept?

Thanks, but what i really would like is a very simple setup like this;

  1. Developer english defines the keys that i want to have translated
    {
    “Hi” : "Hi,
    “Hello”: “Hello”,

    }

  2. I run the localazy cli with the upload command.

  3. Localazy translates my source language (Developer english) into the defined languages i have in localazy.

  4. I run localazy download and i get one file downloaded for each of my defined languages called {lang}.json.

This should be the basic operation of this service, imho.

This is, indeed, the very basic functionality of Localazy.

The best would be to contact us through the intercom chat on our page and ask for a demo with my colleague Dan who will help you to achieve exactly this configuration in a couple of minutes.

Ok - i will do that.