Add translation support to reply items (#1894)

* Add translation support to reply items

- Add translateState and showTranslate fields to ReplyControl
- Add translatedText field to ReplyInfo for translation results
- Implement TranslateReplyReq message and translateReply API method
- Add translation UI with loading state and result display in reply
  items
- Show translation button when showTranslate is true and translateState
  is 2

* refa

Signed-off-by: dom <githubaccount56556@proton.me>

---------

Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
lesetong
2026-04-16 12:40:39 +08:00
committed by GitHub
parent 0b4ed25891
commit dd2492e04d
5 changed files with 389 additions and 31 deletions

View File

@@ -148,4 +148,20 @@ abstract final class ReplyGrpc {
SearchItemReply.fromBuffer,
);
}
static Future<LoadingState<TranslateReplyResp>> translateReply({
required Int64 type,
required Int64 oid,
required Int64 rpid,
}) {
return GrpcReq.request(
GrpcUrl.translateReply,
TranslateReplyReq(
type: type,
oid: oid,
rpid: [rpid],
),
TranslateReplyResp.fromBuffer,
);
}
}