fix(client): add an empty array to allow iterating over an array containing newline (#222)
An array containing simply a newline ['\n','other text'] will error on this line. Adding an empty array to allow it to iterate solves it.
This commit is contained in:
parent
5dd9bc5819
commit
77980b298a
@ -187,7 +187,7 @@ class Translator:
|
|||||||
data, response = self._translate(text, dest, src, kwargs)
|
data, response = self._translate(text, dest, src, kwargs)
|
||||||
|
|
||||||
# this code will be updated when the format is changed.
|
# this code will be updated when the format is changed.
|
||||||
translated = ''.join([d[0] if d[0] else '' for d in data[0]])
|
translated = ''.join([d[0] if d[0] else '' for d in data[0] or []])
|
||||||
|
|
||||||
extra_data = self._parse_extra_data(data)
|
extra_data = self._parse_extra_data(data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user