Skip to content

Commit

Permalink
fix: Missing translations
Browse files Browse the repository at this point in the history
  • Loading branch information
TechDecryptor authored Oct 27, 2023
1 parent 1c7853e commit 13a1e94
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,12 @@ fn parse_result(res: &Value, client: &Client) -> Option<Value> {
let mut result = String::new();
let translate_result = res.as_object()?.get("translateResult")?.as_array()?;

for line in translate_result {
let tgt = line
.as_array()?
.get(0)?
.as_object()?
.get("tgt")?
.as_str()?
.to_string();
result.push_str(&tgt);
for p in translate_result {
let p = p.as_array()?;
for l in p {
let tgt = l.as_object()?.get("tgt")?.as_str()?.to_string();
result.push_str(&tgt);
}
}
return Some(Value::String(result));
}
Expand Down

0 comments on commit 13a1e94

Please sign in to comment.