fix(legacy): update SOL token transfer related text#143
Conversation
WalkthroughTwo new string keys for "To (Token Account):" and "From (Token Account):" were added to the internationalization system. All supported languages received matching translations. The Solana transaction signing UI now uses these new labels for token sender and recipient fields. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Device UI
participant Solana Firmware
User->>Device UI: Initiate Solana transaction signing
Device UI->>Solana Firmware: Request transaction summary
Solana Firmware->>Device UI: Provide summary with "From (Token Account):" and "To (Token Account):"
Device UI->>User: Display new token account labels in selected language
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (10)
legacy/firmware/i18n/keys.h(1 hunks)legacy/firmware/i18n/locales/de.inc(1 hunks)legacy/firmware/i18n/locales/en.inc(1 hunks)legacy/firmware/i18n/locales/es.inc(1 hunks)legacy/firmware/i18n/locales/ja.inc(1 hunks)legacy/firmware/i18n/locales/pt_br.inc(1 hunks)legacy/firmware/i18n/locales/zh_cn.inc(1 hunks)legacy/firmware/i18n/locales/zh_tw.inc(1 hunks)legacy/firmware/solana.c(3 hunks)vendor/libsol(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Gen check
- GitHub Check: Defs check
- GitHub Check: Style check
🔇 Additional comments (10)
legacy/firmware/i18n/keys.h (1)
791-794: Add new token account keys
Keys for "To (Token Account)" and "From (Token Account)" are appended sequentially with IDs 380 and 381. Ensure these new keys sync with the UI code that references them.legacy/firmware/i18n/locales/zh_tw.inc (1)
382-383: Add traditional Chinese token account labels
Translations align with the new keys for To/From token accounts.legacy/firmware/i18n/locales/pt_br.inc (1)
382-383: Add Portuguese token account labels
Labels correctly represent To/From token accounts in Portuguese.legacy/firmware/i18n/locales/zh_cn.inc (1)
382-383: Add simplified Chinese token account labels
Strings match the new key definitions and follow the correct order.legacy/firmware/i18n/locales/es.inc (1)
382-383:Details
✅ Verification successful
LGTM! Spanish translations look correct.
The Spanish translations "A (Cuenta Token):" and "De (Cuenta Token):" properly correspond to "To (Token Account):" and "From (Token Account):". The grammar and formatting are appropriate.
Verify that the corresponding internationalization keys
LIST_KEY__TO_TOKEN_ACCOUNT__COLONandLIST_KEY__FROM_TOKEN_ACCOUNT__COLONare properly defined inlegacy/firmware/i18n/keys.h:
🏁 Script executed:
#!/bin/bash # Check if the new internationalization keys are defined rg -A 2 -B 2 "TOKEN_ACCOUNT.*COLON" legacy/firmware/i18n/keys.hLength of output: 267
Approved: Spanish locale entries added correctly
The Spanish translations “A (Cuenta Token):” and “De (Cuenta Token):” align with the English keys, and both
LIST_KEY__TO_TOKEN_ACCOUNT__COLON(line 380) and
LIST_KEY__FROM_TOKEN_ACCOUNT__COLON(line 381)
are defined inlegacy/firmware/i18n/keys.h.All set!
legacy/firmware/i18n/locales/en.inc (1)
382-383: Clear and descriptive English labels added.The new labels "To (Token Account):" and "From (Token Account):" are more explicit and user-friendly than the previous "Token Sender"/"Token Recipient". Good improvement for clarity!
legacy/firmware/i18n/locales/de.inc (1)
382-383: German translations follow proper conventions.The German translations "An (Token-Konto):" and "Von (Token-Konto):" are grammatically correct. The hyphenated compound "Token-Konto" follows German language conventions.
legacy/firmware/solana.c (3)
113-113: Cleaner array initialization.Good simplification!
char desc[64] = {0}is cleaner than manual zeroing.
151-151: Safe string formatting improvement.Good use of
snprintffor safe string formatting. The 64-byte buffer is adequate for the format string.
136-139:Details
✅ Verification successful
Verify that new labels are properly localized.
The new token account label mappings look correct, but ensure these strings use the internationalization system rather than hardcoded English text.
Check if these labels should use
gettext_from_en()or similar localization functions:
🏁 Script executed:
#!/bin/bash # Search for how other labels are localized in this function rg -A 5 -B 5 "gettext_from_en.*:" legacy/firmware/solana.cLength of output: 60
🏁 Script executed:
#!/bin/bash # Search for any usage of the gettext_from_en localization function in the firmware directory rg -n "gettext_from_en" -n legacy/firmwareLength of output: 1508
🏁 Script executed:
#!/bin/bash # Display context around the Token Sender/Recipient labels in solana.c sed -n '120,200p' legacy/firmware/solana.cLength of output: 2965
All new labels are already localized
The new “From (Token Account)” and “To (Token Account)” strings feed into gettext_from_en(desc) in layoutDialogAdapterEx, just like every other title. No further changes are needed.
Summary by CodeRabbit