Blank values sending data to the API

When I use the API to send an array of strings to translate, some of the values are blank (i.e. contain no value). This appears to throw a translation error. However using the Portal blank values are accepted. How can I translate an input with empty values (i.e., "one", "two", "", "three")

emoji
Parents
  • Hello Chris,

     

    You are indeed receiving that error message via the API because one of the elements in the array is empty. The reason it works in the UI is because it uses a different type of submission/input format, it treats the text you put in the UI as a full string, not an array of elements.

    Can you please provide more details on your use case and requirements either via this post or I can reach out by email with some proposed timings and we can have a quick sync.

     

    Look forward to your feedback.

     

    Thank you,

    Madalina

    emoji
  • Hi Madalina,

    Here is a typical language property file with key value pairs that includes an element that does not contain a value:

    UNKNOWN=
    NEW=New
    UPDATE=Update
    DELETE=Delete

    When this language property file is parsed into into an array, the values are ["", "New", "Update", "Delete"] , which as you have noted throws an error when the data object is posted to the API. I suspected this might be an anomaly of the API, so I attempted to introduce a unique value into the blank, prior to posting, (i.e. ["BLANK TRANSLATION VALUE", "New", "Update", "Delete"] ), then use the Dictionary to replace BLANK TRANSLATION VALUE with BLANK TRANSLATION VALUE, and then replace BLANK TRANSLATION VALUE in the API response with a blank field in the language property file. Unfortunately, the Dictionary function isn't working for me and I have another support question that is trying to resolve that issue.

    I would be open to any suggestion you may have.

    Thanks,

    Chris

    emoji
Reply
  • Hi Madalina,

    Here is a typical language property file with key value pairs that includes an element that does not contain a value:

    UNKNOWN=
    NEW=New
    UPDATE=Update
    DELETE=Delete

    When this language property file is parsed into into an array, the values are ["", "New", "Update", "Delete"] , which as you have noted throws an error when the data object is posted to the API. I suspected this might be an anomaly of the API, so I attempted to introduce a unique value into the blank, prior to posting, (i.e. ["BLANK TRANSLATION VALUE", "New", "Update", "Delete"] ), then use the Dictionary to replace BLANK TRANSLATION VALUE with BLANK TRANSLATION VALUE, and then replace BLANK TRANSLATION VALUE in the API response with a blank field in the language property file. Unfortunately, the Dictionary function isn't working for me and I have another support question that is trying to resolve that issue.

    I would be open to any suggestion you may have.

    Thanks,

    Chris

    emoji
Children
No Data