Skip to content
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

Allow SegmentedControl translate titles on the fly #720

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

ukane-philemon
Copy link
Collaborator

This PR changes the required segmented titles from pre-translated to the translation key to allow SegmntedControl to translate on the fly and be able to handle cases where language change might result to incorrect segmented title equality checks.

SegmentedControl.SetSelectedSegment now accepts an actual translation key instead of a pre-translated string and SegmentedContol.SelectedSegment returns the same.

Comment on lines 169 to +170
func (dst *destination) isSendToAddress() bool {
return dst.accountSwitch.SelectedSegment() == values.String(values.StrAddress)
return dst.accountSwitch.SelectedSegment() == values.StrAddress
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is one case where the formal approach caused the send page to not function properly due to an incorrect equality check.

SelectedSegment() was returning a pre-translated string(english) and values.String(values.StrAddress) was returning the current string translation(e.g french) after a language change.

@dreacot dreacot merged commit 66a8f3e into crypto-power:master Jan 30, 2025
1 check passed
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