phrase / phrase-cli

CLI for the Phrase API
https://developers.phrase.com
MIT License
42 stars 6 forks source link

phraseupp will delete a key if string is empty #63

Closed Wendenburg closed 3 years ago

Wendenburg commented 3 years ago

Example: // bar is not needed for this language { foo: 'my phrase', bar: '' }

after phraseapp push and pull again json for this language will look like { foo: 'my phrase' }

Expected result is that the key is not deleted from the json file.

theSoenke commented 3 years ago

Hi @Wendenburg, empty translations are not exported by default but there is a option include_empty_translations: true to keep them.

phrase:
  file_format: simple_json
  pull:
    targets:
      -
        file: ./app/<locale_name>.json
        project_id: <PROJECT_ID>
        params:
          include_empty_translations: true

Let me know if this already helps.

theSoenke commented 3 years ago

Did this resolve the issue? I'll close this for now but please leave a comment if there is still any problem.