lokalise / lokalise-cli-2-go

Lokalise CLI v2
Other
108 stars 52 forks source link

File upload option "--convert-placeholders" does not work #99

Closed KotschM closed 2 years ago

KotschM commented 2 years ago

I tried to upload a file. I do not want the localise placeholder to be inserted. Therefore I used the flag/option "--convert-placeholder". Unfortunately the localise-placeholder is still inserted.

When I upload the file via Lokalise-UI, omitting the Lokalise-placeholder works. Uploading directly via the Lokalise API also works as desired.

The following command creates an upload with Lokalise placeholders:

lokalise2 \
    --token <token> \
    --project-id <project_id> \
    file upload \
    --convert-placeholders false \
    --file ./src/lang/template.json \
    --lang-iso en

The following REST call works without problems:

curl --request POST \
     --url https://api.lokalise.com/api2/projects/<project_id>/files/upload \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '
{
     "data": "testData",
     "filename": "index.json",
     "lang_iso": "en",
     "convert_placeholders": false
}
'

Is there another way to do a file upload without localise placeholders using the CLI tool?

KotschM commented 2 years ago

The fault was mine. Flags/options of type Boolean must be used with a '='.

The correct command is:

lokalise2 \
    --token <token> \
    --project-id <project_id> \
    file upload \
    --convert-placeholders=false \
    --file ./src/lang/template.json \
    --lang-iso en