Skip to content

fix(legacy): update SOL token transfer related text#143

Merged
somebodyLi merged 1 commit intomasterfrom
3.12.0
May 30, 2025
Merged

fix(legacy): update SOL token transfer related text#143
somebodyLi merged 1 commit intomasterfrom
3.12.0

Conversation

@somebodyLi
Copy link
Contributor

@somebodyLi somebodyLi commented May 30, 2025

Summary by CodeRabbit

  • New Features
    • Added new labels for "To (Token Account)" and "From (Token Account)" in transaction summaries, now available in English, German, Spanish, Japanese, Portuguese, and Chinese (Simplified and Traditional).
  • Style
    • Improved consistency in transaction summary titles during the signing process.

@coderabbitai
Copy link

coderabbitai bot commented May 30, 2025

Walkthrough

Two 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 libsol submodule was updated to a newer commit.

Changes

Files/Paths Change Summary
legacy/firmware/i18n/keys.h Added two new string key definitions for token account labels.
legacy/firmware/i18n/locales/en.inc
.../de.inc
.../es.inc
.../ja.inc
.../pt_br.inc
.../zh_cn.inc
.../zh_tw.inc
Added translations for "To (Token Account):" and "From (Token Account):" in all supported languages.
legacy/firmware/solana.c Updated transaction signing UI to use new token account labels and improved string formatting.
vendor/libsol Updated submodule to a newer commit.

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
Loading
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or Summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4895b47 and ff820af.

📒 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__COLON and LIST_KEY__FROM_TOKEN_ACCOUNT__COLON are properly defined in legacy/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.h

Length 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 in legacy/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 snprintf for 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.c

Length 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/firmware

Length 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.c

Length 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.

@somebodyLi somebodyLi enabled auto-merge (squash) May 30, 2025 07:10
@somebodyLi somebodyLi merged commit 5065950 into master May 30, 2025
6 of 8 checks passed
@somebodyLi somebodyLi deleted the 3.12.0 branch May 30, 2025 07:12
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.

3 participants