qt: fix sub-asset creation in non-English locales (#440)#452
Open
JSanchezFDZ wants to merge 1 commit into
Open
qt: fix sub-asset creation in non-English locales (#440)#452JSanchezFDZ wants to merge 1 commit into
JSanchezFDZ wants to merge 1 commit into
Conversation
onAssetTypeSelected() compared the asset-type combobox against the English literals "Root"/"Sub". The combobox text is translated by Qt in non-English locales, so neither branch matched and the root-asset selector was never shown, making it impossible to pick a parent asset when creating a sub-asset in any language other than English. Switch the check to the locale-independent item index (index 0 == Root, any other index == Sub), matching how the rest of the dialog already determines the asset type (issue Raptor3um#418).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the wallet display language is set to anything other than English,
the Create asset dialog does not show the root-asset selector after
choosing the Sub asset type, so a parent asset can never be selected
and sub-asset creation becomes impossible (issue #440).
Root cause
CreateAssetsDialog::onAssetTypeSelected()was driven by the translatedcombobox text:
In non-English locales Qt translates the combobox items (e.g. "Racine" /
"Sous" in French), so neither branch matches, the
else ifis skipped andRootAssetBox/RootAssetLabelare never made visible.Fix
Use the locale-independent item index instead (index 0 == Root, any other
index == Sub), which is exactly how the rest of the dialog already decides
the asset type after #418. The translated string is no longer compared, so
the behaviour is identical across all languages.
Closes #440.