Skip to content

feat: Translate an email#2905

Open
Elouan1411 wants to merge 26 commits into
summaryfrom
translate-email
Open

feat: Translate an email#2905
Elouan1411 wants to merge 26 commits into
summaryfrom
translate-email

Conversation

@Elouan1411
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an "Translate an email" feature powered by Euria. A new translate action is exposed in the message/thread bottom sheets, the AI banner block is reworked to support multiple AI actions (summary + translate) side by side, the message Body model gains a translatedValue field, and a new aiTranslate API call is added.

Changes:

  • Introduce translate action UI (icon, action item, banner state, "show original" flow) and persist translatedValue on Body.
  • Refactor InformationBlockView, ThreadAdapter, and ThreadFragment to handle two parallel AI banners (summary/translate) with a shared dismiss/retry/state pipeline and a new Dismissed state.
  • Add OPEN_AI_TRANSLATE_BOTTOM_SHEET navigation, aiTranslate API endpoint, translated strings in all locales, and isAlready{Translated,Summarized} nav args.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/src/main/res/values*/strings.xml New translate-related strings across all locales.
app/src/main/res/values/dimens.xml Adds marginComplementaryButton dimension.
app/src/main/res/navigation/main_navigation.xml Adds isAlreadyTranslated/isAlreadySummarized args to message/thread action dialogs.
app/src/main/res/layout/view_information_block.xml Converts to ConstraintLayout to support close button + button progress layout.
app/src/main/res/layout/item_message.xml Replaces single AI banner with two InformationBlockViews for summary and translate.
app/src/main/res/layout/item_bottom_sheet_action.xml Applies disabled tint/text colors.
app/src/main/res/layout/bottom_sheet_actions_menu.xml Adds "Translate" action item.
app/src/main/res/drawable/ic_translate.xml New translate icon.
views/InformationBlockView.kt New properties/helpers (close button, animation, button progress, margins).
utils/MessageBodyUtils.kt Adds (currently unused) imports.
utils/ErrorCode.kt Adds TRANSLATION_TARGET_SAME_AS_SOURCE.
ui/main/thread/ThreadViewModel.kt Splits/handles translated body, adds save/remove translation methods.
ui/main/thread/ThreadState.kt Adds translate state map, cached translated split bodies, Dismissed state.
ui/main/thread/ThreadFragment.kt Wires translate flow, dismissal, banners and per-action retry timers.
ui/main/thread/ThreadAdapter.kt Generalizes banner binding for SUMMARY/TRANSLATE; uses new InformationBlockView API.
ui/main/thread/PrintMailFragment.kt Exposes aiTranslateStateMap.
ui/main/thread/actions/*BottomSheetDialog.kt + ActionItemView.kt + MailActionsBottomSheetDialog.kt Translate action handler, enabled/visibility helpers, disabled state for ActionItemView.
MatomoMail.kt Adds Translate Matomo name.
data/models/message/Body.kt Adds translatedValue and isTranslated.
data/api/ApiRoutes.kt + ApiRepository.kt Adds aiTranslate endpoint and call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/infomaniak/mail/utils/MessageBodyUtils.kt Outdated
@Elouan1411 Elouan1411 marked this pull request as draft May 13, 2026 09:23
@Elouan1411 Elouan1411 marked this pull request as ready for review May 13, 2026 11:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.

Comment thread app/src/main/res/layout/item_bottom_sheet_action.xml
Comment thread app/src/main/res/layout/view_information_block.xml
Comment thread app/src/main/java/com/infomaniak/mail/data/models/message/Body.kt
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants