simplelocalize / simplelocalize-cli

SimpleLocalize CLI is a developer-friendly command-line tool for uploading and downloading translation files
https://simplelocalize.io
MIT License
56 stars 11 forks source link

JSON downloaded files are not nested with WRITE_NESTED download option in config file #83

Closed amine1803 closed 10 months ago

amine1803 commented 10 months ago

Describe the bug When downloading JSON files for translation (any path, any format), the keys are not nested with WRITE_NESTED download option in config file. The nesting works when using the script directly in the terminal.

This works in the terminal:

simplelocalize download \
 --apiKey MY_API_KEY \
 --downloadPath ./translations.json \
 --downloadFormat multi-language-json \
 --downloadOptions WRITE_NESTED,INCLUDE_DESCRIPTIONS

This does not work using the simplelocalize.yml config

simplelocalize download
###################################
# 'simplelocalize download' command
###################################

# Download path is a path to a file(s) with translations. Use {lang} placeholder to specify language or locale and {ns} placeholder to specify namespace.
# For example, if you have translations in 2 languages and 2 namespaces, you can use the following path: ./src/translations/{lang}/{ns}.json
downloadPath: ./public/locales/{lang}/{ns}.json

# Download format is a format of the file(s) with translations.
# Supported formats: https://simplelocalize.io/docs/general/file-formats/
downloadFormat: single-language-json

# Download options are options that are passed to the download command.
# Supported options: https://simplelocalize.io/docs/general/options/
downloadOptions:
  - WRITE_NESTED # write nested JSON

FYI, the quotes around WRITE_NESTED does not change the outcome.

Thank you.

CLI Version

Operating system (please complete the following information):

Screenshots If applicable, add screenshots to help explain your problem.

jpomykala commented 10 months ago

Hey @adanane

Thanks for reporting this. The issue has been resolved, and it will be available in the next update.

jpomykala commented 10 months ago

Hey @adanane

The fix has been implemented in version 2.4.1: https://github.com/simplelocalize/simplelocalize-cli/releases/tag/2.4.1