Skip to content

Commit

Permalink
fix: image translate don‘t detect language
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Aug 31, 2023
1 parent e37ac68 commit 2f84c69
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/window/Translate/components/SourceArea/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ export default function SourceArea() {
.recognize(base64, recognizeServices[serviceList[0]].Language[language])
.then(
(v) => {
setSourceText(v, true);
setSourceText(v);
detect_language(v).then(() => {
if (getIncrementalTranslate()) {
setSourceText((old) => {
return old + ' ' + v;
}, true);
} else {
setSourceText(v, true);
}
});
},
(e) => {
setSourceText(e.toString());
Expand Down

0 comments on commit 2f84c69

Please sign in to comment.