Skip to content

Conversation

@Matobi98
Copy link
Contributor

@Matobi98 Matobi98 commented Jan 27, 2026

Fix: Dispute messages now respect each user's language

Problem

When users involved in a dispute had different bot languages configured, dispute-related messages were sent using the language of who triggered the action, instead of the language of each recipient.

This caused inconsistent behavior, for example:

  • If Alice (EN) opened a dispute with Bob (FR), Bob received the message in English.
  • If an admin (ES) took the dispute, both Alice and Bob received the message in Spanish.

Each user should always receive bot messages in their own configured language.

Summary by CodeRabbit

  • Refactor
    • Dispute notifications now determine initiator/counterparty and deliver messages in each party’s preferred language, improving clarity for buyers and sellers.
  • Chores
    • Minor public API adjustment for dispute initiation callers to supply order context when starting a dispute.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

Adds getDisputeParties to centralize resolution of initiator and counterparty users and their i18n contexts; updates beginDispute and disputeData to use this helper, adjusts beginDispute signature to include an order parameter, and localizes dispute messages per party language.

Changes

Cohort / File(s) Summary
Dispute message logic & signature
bot/modules/dispute/messages.ts
Adds getDisputeParties() helper that returns initiatorUser, counterPartyUser, and language contexts (buyerLanguage, sellerLanguage, counterpartyLanguage). Refactors beginDispute() and disputeData() to use the helper, localizes messages per party, and updates beginDispute signature to include order: IOrder. Also extends imports to include getUserI18nContext.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through lines of code today,
Found gaps and stitched the language way,
Parties named, translations clear,
Hopping messages far and near 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix: Languages ​​changed when opening a dispute' accurately describes the main objective of the changeset, which is to fix language localization issues in dispute-related messages so each user receives messages in their configured language.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant