Skip to content

Commit

Permalink
fix: The problem of long text translation results being intercepted
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeep committed Aug 27, 2024
1 parent 0b60917 commit f6b23f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pipeline/after.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ function after(
console.log(`${source}\n${isOverflow ? ` > ${sourceText}` : ''}`);
}

let translationText = result.text;
showPhonetics && (translationText += ` /${result.to.text.phonetics}/`);
let translationText = result.to.text.value;
showPhonetics && result.to.text.phonetics && (translationText += ` /${result.to.text.phonetics}/`);

const isOverflow = translationText.length > columns;
if (showPhonetics || showSource || showDetail) {
const translation = new Translation(isOverflow ? '' : translationText).toString();
console.log(`${translation}${isOverflow ? `\n > ${translationText}` : ''}`);
} else {
console.log(result.text);
console.log(result.to.text.value);
}

if (showDetail) {
Expand Down

0 comments on commit f6b23f7

Please sign in to comment.