-
Notifications
You must be signed in to change notification settings - Fork 160
feat: add protocol fee descriptions in multiple languages #6563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR adds Spanish and Russian translations for protocol-fee-related UI text and adjusts one Spanish swap/bridge cost message; only locale (.po) and translation strings in frontend files were modified, no runtime logic changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/cowswap-frontend/src/locales/en-US.po (1)
2172-2173: Spanish string inen-USlocale for order typeThis
en-UStranslation is in Spanish:msgid "{orderType} {orderKind} order" msgstr "Orden {orderType} {orderKind}"It should be English (or identical to
msgid) to avoid mixed-language UI in the English locale.Suggested fix:
-msgstr "Orden {orderType} {orderKind}" +msgstr "{orderType} {orderKind} order"
🧹 Nitpick comments (1)
apps/cowswap-frontend/src/locales/es-ES.po (1)
6214-6220: Spanish copy is good; optional micro-tweak for fluency.Consider “únicamente” for a slightly smoother read. Keep “solvers” if that’s your chosen term across locales.
msgstr "" -"Comisión aplicada solo si se ejecuta la operación, para incentivar una " -"competencia sólida de solvers que ofrezca precios líderes en el ecosistema." +"Comisión aplicada únicamente si la operación se ejecuta, para incentivar una " +"competencia sólida de solvers que ofrezca precios líderes en el ecosistema."
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/cowswap-frontend/src/locales/en-US.po(1 hunks)apps/cowswap-frontend/src/locales/es-ES.po(1 hunks)apps/cowswap-frontend/src/locales/ru-RU.po(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-07-24T10:00:45.353Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/hooks/useHighFeeWarning.ts:36-36
Timestamp: 2025-07-24T10:00:45.353Z
Learning: In the CowSwap frontend, when there's a bridgeFee present in the transaction, the isSell flag is always true for business reasons. This means bridge transactions are always structured as sell operations, which ensures consistent currency handling in fee percentage calculations.
Applied to files:
apps/cowswap-frontend/src/locales/en-US.po
📚 Learning: 2025-05-27T12:20:54.659Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5762
File: apps/cowswap-frontend/src/legacy/state/orders/utils.ts:499-503
Timestamp: 2025-05-27T12:20:54.659Z
Learning: In the CowSwap frontend, when displaying volume fees in the UI (like in ReceiptModal), zero fees (0 bps) should be treated as "free" and hidden from display. Only non-zero fees should show the "Total fee" line. This provides a cleaner UX by not cluttering the interface with "0.00%" fee displays.
Applied to files:
apps/cowswap-frontend/src/locales/en-US.po
📚 Learning: 2025-07-24T16:42:53.154Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx:23-33
Timestamp: 2025-07-24T16:42:53.154Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx, the use of toFixed(2) for percentage formatting in tooltip content is intentional and differs from the banner message formatting that uses toSignificant(2, undefined, Rounding.ROUND_DOWN). This formatting difference serves different UX purposes and should not be flagged as inconsistent.
Applied to files:
apps/cowswap-frontend/src/locales/en-US.po
📚 Learning: 2025-07-24T16:43:47.639Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts:18-20
Timestamp: 2025-07-24T16:43:47.639Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts, the formatFeePercentage function uses ROUND_DOWN with toSignificant(2) for "at least X%" messaging. This ensures the displayed percentage is never higher than the actual fee, making the "at least" phrasing accurate. For example, if the actual fee is 25.4%, displaying "at least 25%" is correct, but "at least 26%" would be misleading.
Applied to files:
apps/cowswap-frontend/src/locales/en-US.po
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Setup
- GitHub Check: Cypress
🔇 Additional comments (4)
apps/cowswap-frontend/src/locales/en-US.po (1)
6285-6290: New protocol-fee description entry looks correctThe new multi-line fee description has no interpolation variables, the
msgid/msgstrmatch, and wrapping is valid PO syntax. No changes needed here.apps/cowswap-frontend/src/locales/ru-RU.po (1)
6214-6225: Protocol fee translations and placeholders look correctThe new Russian tooltip and both protocol fee labels accurately reflect the English meaning, keep the tone consistent with existing fee texts, and preserve the
{protocolFeeAsPercent}placeholder and formatting correctly. No changes needed.apps/cowswap-frontend/src/locales/es-ES.po (2)
6221-6223: LGTM: placeholder preserved and formatted correctly.Parentheses and {protocolFeeAsPercent}% retained as required.
6224-6225: PR locale coverage verified; current translation is consistent with established terminology.The keys "Protocol fee ({protocolFeeAsPercent}%)" and "Protocol fee" are present in all required locales:
- en-US.po (lines 2505, 2722)
- es-ES.po (lines 6221, 6224)
- ru-RU.po (lines 6221, 6224)
The translation "Comisión del protocolo" is correct and consistent with how protocol-level and general fees are rendered throughout es-ES.po. The alternative "Cuota del protocolo" would create inconsistency—"cuota" is reserved in the codebase for specific fee types (partner quotas, pool tier fees, position fees), not protocol fees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would translate this
Swap and bridge costs are at least {formattedFeePercentage}% of the swap amount"
To the follwoing:
Los costos de Swap y Bridge seran por los menos {formattedFeePercentage}% del monto de intercambio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are things that imo dont have a direct translation or dont need one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing. Addressed in 4af1253
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this one:
msgid ""
"The fee, applied only if the trade is executed, in order to incentivize a "
"strong solver competition that provides ecosystem leading prices."
I would translate it like this:
"Comisión aplicada solo en el caso de que se ejecute la operación, para incentivar una "
"competición sólida de solvers la cual ofrece los precios líderes del ecosistema."
however note, that my reading makes me thing this spanish is Latino spanish and not spain spanish, and I am going with my spain spanish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing. Addressed in 4af1253
5c97a28 to
2ba5835
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/cowswap-frontend/src/locales/ru-RU.po (1)
3260-3262: Optional: align BPS abbreviation and phrasing with existing fee stringsThe meaning is accurate, but for consistency with other RU fee texts (which keep the
BPSabbreviation and often say “в размере … BPS”), you might tweak this:-msgstr "Комиссия {protocolFeeBps} б.п. стимулирует солверов находить лучшие цены для пользователей. Она взимается только при выполнении сделки." +msgstr "Комиссия в размере {protocolFeeBps} BPS стимулирует солверов находить лучшие цены для пользователей. Она взимается только при выполнении сделки."Purely stylistic; no functional impact.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/cowswap-frontend/src/locales/es-ES.po(4 hunks)apps/cowswap-frontend/src/locales/ru-RU.po(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/cowswap-frontend/src/locales/es-ES.po
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-24T16:42:53.154Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx:23-33
Timestamp: 2025-07-24T16:42:53.154Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx, the use of toFixed(2) for percentage formatting in tooltip content is intentional and differs from the banner message formatting that uses toSignificant(2, undefined, Rounding.ROUND_DOWN). This formatting difference serves different UX purposes and should not be flagged as inconsistent.
Applied to files:
apps/cowswap-frontend/src/locales/ru-RU.po
📚 Learning: 2025-07-24T16:43:47.639Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts:18-20
Timestamp: 2025-07-24T16:43:47.639Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts, the formatFeePercentage function uses ROUND_DOWN with toSignificant(2) for "at least X%" messaging. This ensures the displayed percentage is never higher than the actual fee, making the "at least" phrasing accurate. For example, if the actual fee is 25.4%, displaying "at least 25%" is correct, but "at least 26%" would be misleading.
Applied to files:
apps/cowswap-frontend/src/locales/ru-RU.po
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Setup
- GitHub Check: Cypress
🔇 Additional comments (2)
apps/cowswap-frontend/src/locales/ru-RU.po (2)
2527-2529: Protocol fee label with percentage looks correctPlaceholders and wording are preserved and natural in RU; matches the English intent.
2721-2723: Standalone “Protocol fee” label translation is correctSimple, accurate, and consistent with the percent variant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/cowswap-frontend/src/locales/ru-RU.po (1)
3260-3263: Tooltip translation is accurate; minor terminology nit around “solvers”The sentence structure and meaning match the English original, and
{protocolFeeBps}is correctly preserved. One optional improvement: for consistency with other Russian strings, you may want to align how “solvers” is rendered (e.g., keep using the same term across all mentions, whether that’s “solvers”, “решатели”, etc.).For example:
-msgstr "Комиссия в размере {protocolFeeBps} BPS стимулирует солверов находить лучшие цены для пользователей. Она взимается только при выполнении сделки." +msgstr "Комиссия в размере {protocolFeeBps} BPS стимулирует solvers находить лучшие цены для пользователей. Она взимается только при выполнении сделки."(Or adjust to whatever term the translation team has standardized on.)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/cowswap-frontend/src/locales/ru-RU.po(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-24T16:42:53.154Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx:23-33
Timestamp: 2025-07-24T16:42:53.154Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx, the use of toFixed(2) for percentage formatting in tooltip content is intentional and differs from the banner message formatting that uses toSignificant(2, undefined, Rounding.ROUND_DOWN). This formatting difference serves different UX purposes and should not be flagged as inconsistent.
Applied to files:
apps/cowswap-frontend/src/locales/ru-RU.po
📚 Learning: 2025-07-24T16:43:47.639Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts:18-20
Timestamp: 2025-07-24T16:43:47.639Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts, the formatFeePercentage function uses ROUND_DOWN with toSignificant(2) for "at least X%" messaging. This ensures the displayed percentage is never higher than the actual fee, making the "at least" phrasing accurate. For example, if the actual fee is 25.4%, displaying "at least 25%" is correct, but "at least 26%" would be misleading.
Applied to files:
apps/cowswap-frontend/src/locales/ru-RU.po
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Cypress
- GitHub Check: Setup
🔇 Additional comments (2)
apps/cowswap-frontend/src/locales/ru-RU.po (2)
2527-2530: Protocol fee label translation and interpolation look correct
{protocolFeeAsPercent}placeholder and%formatting are preserved, and “Комиссия протокола ({protocolFeeAsPercent}%)” is clear and consistent with other fee labels.
2721-2724: “Protocol fee” label is consistent and idiomatic“Комиссия протокола” matches the longer label above and aligns with existing fee terminology in this locale. No issues here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
apps/cowswap-frontend/src/locales/ru-RU.po (1)
2755-2758: DeduplicateProtocol feemsgid; translation itself is goodSame situation here: an earlier block (around Line 2718) already defines
msgid "Protocol fee" msgstr ""and this new block defines the same
msgidagain. Please merge these so there is only oneProtocol feeentry (withmsgstr "Комиссия протокола"), rather than two separate definitions.The Russian phrasing “Комиссия протокола” is appropriate; just ensure it lives in a single msgid block.
🧹 Nitpick comments (2)
apps/cowswap-frontend/src/locales/es-ES.po (2)
2557-2559: Protocol fee label with %: translation and placeholders look correct
{protocolFeeAsPercent}placeholder and%suffix are preserved.- “Comisión del protocolo ({protocolFeeAsPercent}%)” is clear and appropriate Spanish.
Optionally, consider cleaning up the earlier duplicate
msgid "Protocol fee ({protocolFeeAsPercent}%)"with emptymsgstrso there’s a single source for this translation, but this is non-blocking and tooling may already handle it.
2755-2758: Plain “Protocol fee” label: consistent, correct translation
- “Comisión del protocolo” matches the percentage label and broader fee terminology.
- Placeholders are not involved here, so no formatting risks.
As with the percentage label, you may want to deduplicate earlier
msgid "Protocol fee"entries to avoid redundant definitions, but it’s not urgent.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/cowswap-frontend/src/locales/es-ES.po(4 hunks)apps/cowswap-frontend/src/locales/ru-RU.po(3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-07-24T16:42:53.154Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx:23-33
Timestamp: 2025-07-24T16:42:53.154Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/HighFeeWarningTooltipContent.tsx, the use of toFixed(2) for percentage formatting in tooltip content is intentional and differs from the banner message formatting that uses toSignificant(2, undefined, Rounding.ROUND_DOWN). This formatting difference serves different UX purposes and should not be flagged as inconsistent.
Applied to files:
apps/cowswap-frontend/src/locales/ru-RU.poapps/cowswap-frontend/src/locales/es-ES.po
📚 Learning: 2025-07-24T16:43:47.639Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts:18-20
Timestamp: 2025-07-24T16:43:47.639Z
Learning: In apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/highFeeWarningHelpers.ts, the formatFeePercentage function uses ROUND_DOWN with toSignificant(2) for "at least X%" messaging. This ensures the displayed percentage is never higher than the actual fee, making the "at least" phrasing accurate. For example, if the actual fee is 25.4%, displaying "at least 25%" is correct, but "at least 26%" would be misleading.
Applied to files:
apps/cowswap-frontend/src/locales/ru-RU.poapps/cowswap-frontend/src/locales/es-ES.po
📚 Learning: 2025-05-27T12:20:54.659Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5762
File: apps/cowswap-frontend/src/legacy/state/orders/utils.ts:499-503
Timestamp: 2025-05-27T12:20:54.659Z
Learning: In the CowSwap frontend, when displaying volume fees in the UI (like in ReceiptModal), zero fees (0 bps) should be treated as "free" and hidden from display. Only non-zero fees should show the "Total fee" line. This provides a cleaner UX by not cluttering the interface with "0.00%" fee displays.
Applied to files:
apps/cowswap-frontend/src/locales/ru-RU.poapps/cowswap-frontend/src/locales/es-ES.po
📚 Learning: 2025-07-24T10:00:45.353Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6009
File: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/HighFeeWarning/hooks/useHighFeeWarning.ts:36-36
Timestamp: 2025-07-24T10:00:45.353Z
Learning: In the CowSwap frontend, when there's a bridgeFee present in the transaction, the isSell flag is always true for business reasons. This means bridge transactions are always structured as sell operations, which ensures consistent currency handling in fee percentage calculations.
Applied to files:
apps/cowswap-frontend/src/locales/es-ES.po
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Cypress
- GitHub Check: Setup
🔇 Additional comments (3)
apps/cowswap-frontend/src/locales/es-ES.po (2)
3299-3301: Protocol fee tooltip body: accurate and idiomatic ES
{protocolFeeBps}token and “BPS” unit are preserved.- Wording correctly conveys both the incentive and “only if executed” condition in natural Spanish.
No changes needed.
6281-6283: Swap+bridge high-fee warning: translation matches intent and preserves token
{formattedFeePercentage}%is correctly preserved.- Spanish sentence clearly communicates the “at least X% of the swap amount” idea; brand terms “Swap” and “Bridge” are kept as requested.
Looks good as-is.
apps/cowswap-frontend/src/locales/ru-RU.po (1)
3299-3301: Tooltip translation for protocol fee looks correctThe updated Russian text accurately reflects the English tooltip, keeps
{protocolFeeBps}intact, and reads naturally in context (“взимается только при выполнении сделки”). No further changes needed here.
| #: apps/cowswap-frontend/src/modules/trade/pure/ProtocolFeeRow/index.tsx | ||
| msgid "Protocol fee ({protocolFeeAsPercent}%)" | ||
| msgstr "Комиссия протокола ({protocolFeeAsPercent}%)" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid duplicate msgid for Protocol fee ({protocolFeeAsPercent}%)
There is already an entry for this same msgid earlier in the file (around Line 2497) with an empty msgstr. Adding a second block with the same msgid can confuse gettext tooling (duplicate definitions) and makes it unclear which translation wins.
Suggestion: keep a single entry for
msgid "Protocol fee ({protocolFeeAsPercent}%)"
msgstr "Комиссия протокола ({protocolFeeAsPercent}%)"and delete the other duplicated block so this msgid appears only once.
🤖 Prompt for AI Agents
In apps/cowswap-frontend/src/locales/ru-RU.po around lines 2557-2560 (and the
duplicate around line ~2497), there are two msgid entries for "Protocol fee
({protocolFeeAsPercent}%)" which creates a duplicate; remove the
earlier/duplicate block (the one at ~line 2497) and keep a single entry with
msgid "Protocol fee ({protocolFeeAsPercent}%)" and msgstr "Комиссия протокола
({protocolFeeAsPercent}%)", ensuring only one definition exists and no empty
msgstr remains.
|
LGTM! |
Summary
To Test
Background
Fills missing localized strings for the protocol fee UI so ES/RU users see proper labels and tooltips.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.